Temporary implementation of scripture send.

This commit is contained in:
Benjamin A. Shelton 2026-10-20 15:34:03 -06:00
commit 3dc73e3572
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 68 additions and 3 deletions

View file

@ -19,6 +19,9 @@ type Database struct {
ctx context.Context
db *sqlx.DB
conf *settings.Settings
chats *ChatModel
verses *VerseModel
}
func OpenDatabase(ctx context.Context, conf *settings.Settings) *Database {
@ -57,9 +60,15 @@ func (d *Database) Migrate(migrations vfs.VFS) error {
}
func (d *Database) Chats() *ChatModel {
return NewChatModel(d.ctx, d.db)
if d.chats == nil {
return NewChatModel(d.ctx, d.db)
}
return d.chats
}
func (d *Database) Verses() (*VerseModel, error) {
return nil, nil
func (d *Database) Verses() *VerseModel {
if d.verses == nil {
d.verses = NewVerseModel(d.ctx, d.db)
}
return d.verses
}