sqlingo
sqlingo copied to clipboard
💥 A lightweight DSL & ORM which helps you to write SQL in Go.
lqs. The return value is the value of the map is the slice
* Add SQL keyword `NATURAL JOIN`. * Add manual Commit, SavaPoint, Rollback. * Awesome default logger like next: 
* add time range notice. (there is a sql execute err when insert using time.Time{} due out of range)
``` type Database interface { GetDB() *sql.DB BeginTx(ctx context.Context, opts *sql.TxOptions, f func(tx Transaction) error) error // todo // Begin() (Database, error) // SavePoint(name string) error // RollbackTo(name string) error...
Such as `select name from user /* shard_id=1 */ where name like 'can%'`, the shard_id comment is to tell the database proxy how to route to the sharded database. Suggest:...
``` SELECT ...... WHERE "Order"."id" in (1,2,3) AND ("Order"."name" LIKE 'Can%' OR "Order"."price" > 15) ``` to ``` SELECT ...... WHERE "Order"."id" in (?,?,?) AND ("Order"."name" LIKE ? OR "Order"."price"...
Attempting to use the generate executable on a simple postgres database. `sqlingo-gen-postgres postgresql://postgres:password@localhost:5432/dbname?sslmode=disable > ./internal/gen_models.go` gives: ``` Generating code for tables... panic: unknown field type USER-DEFINED goroutine 1 [running]: main.main()...
This pr fix https://github.com/lqs/sqlingo/issues/23