move-migrations-to-option (#1)

Removes global variables and sets up migrations as optional.

Reviewed-on: #1
Co-authored-by: Mason Payne <mason@masonitestudios.com>
Co-committed-by: Mason Payne <mason@masonitestudios.com>
This commit is contained in:
2024-10-16 18:04:01 -06:00
committed by payne8
parent 72df3adf0d
commit b08636ba39
5 changed files with 40 additions and 38 deletions

View File

@ -17,9 +17,9 @@ func main() {
// Open the database
tdb, err := libsqldb.NewLibSqlDB(
primaryUrl,
migrationFiles,
libsqldb.WithMigrationFiles(migrationFiles),
libsqldb.WithAuthToken(authToken),
libsqldb.WithLocalDBName("local.db"),
libsqldb.WithLocalDBName("local.db"), // will not be used for remote-only
)
if err != nil {
fmt.Fprintf(os.Stderr, "failed to open db %s: %s", primaryUrl, err)