communicate-with-app

command
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

communicate-with-app

Use programmatic migration scripts, passing parameters from the calling app using the context.

Use-case: sharing with the migration scripts a logger, config or any other settings from a top-level runner app.

Usage

 go run migrate.go
{"level":"info","logger":"demo","msg":"applying db migrations","operation":"migratedb"}
{"level":"info","logger":"demo","msg":"OK   20231102204811_create_example.sql (2.68ms)","operation":"migratedb"}
{"level":"info","logger":"demo","msg":"OK   20231103204811_populate_example.sql (2.65ms)","operation":"migratedb"}
{"level":"info","logger":"demo","msg":"values inserted from file","entries":2}
{"level":"info","logger":"demo","msg":"OK   20231104120000_load_example.go (2.74ms)","operation":"migratedb"}
sqlite3 testdata/db/example.db 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> select * from example;
one|One
three|name: passed value- Third value
four|name: passed value- Fourth value
sqlite> 

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL