We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import ( "fmt" "github.com/coocood/qbs" _ "github.com/mattn/go-sqlite3" "log" "time" ) type Blog struct { Id int64 Title string `db:"title"` Author string `db:"author"` Published time.Time `db:"published"` } func checkErr(err error, msg string) { if err != nil { log.Fatalln(msg, err) } } func main() { qbs.Register("sqlite3", "blog.db", "qbs_test", qbs.NewSqlite3()) q, err := qbs.GetQbs() fmt.Print(q, err) migration, err := qbs.GetMigration() defer migration.Close() err = migration.CreateTableIfNotExists(new(Blog)) fmt.Println(err) }
generate table schema
CREATE TABLE `blog` ( `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, `title` text, `author` text, `published` text )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
generate table schema
The text was updated successfully, but these errors were encountered: