Add 'Scan to arbitrary destination' wiki page.

This commit is contained in:
go-jet 2019-07-05 15:13:00 +02:00
parent 1ab3ee4be6
commit fb5bf7dd40
5 changed files with 538 additions and 8 deletions

View file

@ -2,16 +2,16 @@
## SQL Builder
SQL Builder files are Go files, containing types necessary to write type safe SQL queries in Go. They are
autogenerated from database tables and enums.
autogenerated from database tables and enums. File names are snake case of the table name or enum name.
### Table SQL Builder files
Following rules are applied to generate table SQL Builder files:
- for every table there is one Go SQL Builder file generated. File name is in snake case of the table name.
- every file contains one type - struct with nested jet.Table. Type name is a camel case of table name.
- for every column of table there is a field column in SQL Builder table type. Field name is camel case of column name.
See below table for type mapping.
- for every table there is one Go SQL Builder file generated.
- every file contains one type - struct with nested jet.Table.
- for every column of table there is a field column in SQL Builder table type.
Field name is camel case of column name. See below table for type mapping.
- `AllColumns` is used as shorthand notation for list of all columns.
- `MutableColumns` are all columns minus primary key columns _(Useful in INSERT or UPDATE statements)_.
@ -82,7 +82,7 @@ type AddressTable struct {
Following rules are applied to generate enum SQL Builder files:
- for every enum there is one Go SQL Builder file generated. File name is in snake case of the enum name.
- for every enum there is one Go SQL Builder file generated.
- every file contains one type. Type name is a camel case of enum name.
- for every enum value there is a field in SQL Builder enum struct. Field name is camel case of enum value. Type is
jet.StringExpression, meaning it can be used by string expressions methods.