modulepackage
0.0.0-20160504131956-5933d0bae362
Repository: https://github.com/edocode/goper.git
Documentation: pkg.go.dev
# README
goper
Utility for generating structs based off of database schemas. Intended to be used with something like sqlx.
Included:
- support for mysql/sqlite (postgres pending)
Documentation
Installation
# install the library:
# install the sqlite development libraries
go get github.com/shanemhansen/goper
Examples
#Add GOPATH/bin to your PATH
go install github.com/shanemhansen/goper/...
schema -driver sqlite3 -dsn path/to/file.sqlite3 > data.go
schema -driver mysql -dsn "user:password@tcp(127.0.0.1:3306)/main" > data.go
# Packages
schema -driver mysql|sqlite3|postgres -dsn dsn Generate a set of a golang structs.
# Functions
A helper function that maps strings like product_variant to ProductVariant.
No description provided by the author
No description provided by the author
# Variables
Session is deprecated in favor of sqlx.
# Structs
No description provided by the author
A column has a name and a database type (hackily converted to a gotype).
A SchemaWriter writes a set of tables to the writer denoted by Outfile.
No description provided by the author
No description provided by the author
A Table represents the metadata associated with a table (columns, datatypes, etc).
# Interfaces
A Dialect is a set of functions for generating the SQL to obtain various metadata about a database.
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author