Update README.
This commit is contained in:
parent
bc2e8aca42
commit
a893dfba44
3 changed files with 9 additions and 11 deletions
|
|
@ -161,7 +161,7 @@ stmt := SELECT(
|
||||||
Film.FilmID.ASC(),
|
Film.FilmID.ASC(),
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
Package(dot) import is used so that statement resemble as much as possible as native SQL. Note that every column has a type. String column `Language.Name` and `Category.Name` can be compared only with
|
Package(dot) import is used so that statement would resemble as much as possible as native SQL. Note that every column has a type. String column `Language.Name` and `Category.Name` can be compared only with
|
||||||
string columns and expressions. `Actor.ActorID`, `FilmActor.ActorID`, `Film.Length` are integer columns
|
string columns and expressions. `Actor.ActorID`, `FilmActor.ActorID`, `Film.Length` are integer columns
|
||||||
and can be compared only with integer columns and expressions.
|
and can be compared only with integer columns and expressions.
|
||||||
|
|
||||||
|
|
@ -219,7 +219,7 @@ __How to get debug SQL from statement?__
|
||||||
```go
|
```go
|
||||||
debugSql := stmt.DebugSql()
|
debugSql := stmt.DebugSql()
|
||||||
```
|
```
|
||||||
debugSql - query string that can be copy pasted to sql editor and executed. It's not intended to be used in production.
|
debugSql - query string that can be copy pasted to sql editor and executed. __It's not intended to be used in production!!!__
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Click to see debug sql</summary>
|
<summary>Click to see debug sql</summary>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.StringVar(&source, "source", "", "Database system name (PostgreSQL or MySQL)")
|
flag.StringVar(&source, "source", "", "Database system name (PostgreSQL, MySQL or MariaDB)")
|
||||||
|
|
||||||
flag.StringVar(&host, "host", "", "Database host path (Example: localhost)")
|
flag.StringVar(&host, "host", "", "Database host path (Example: localhost)")
|
||||||
flag.IntVar(&port, "port", 0, "Database port")
|
flag.IntVar(&port, "port", 0, "Database port")
|
||||||
|
|
@ -37,8 +37,8 @@ func init() {
|
||||||
flag.StringVar(&password, "password", "", "The user’s password")
|
flag.StringVar(&password, "password", "", "The user’s password")
|
||||||
flag.StringVar(¶ms, "params", "", "Additional connection string parameters(optional)")
|
flag.StringVar(¶ms, "params", "", "Additional connection string parameters(optional)")
|
||||||
flag.StringVar(&dbName, "dbname", "", "Database name")
|
flag.StringVar(&dbName, "dbname", "", "Database name")
|
||||||
flag.StringVar(&schemaName, "schema", "public", `Database schema name. (default "public") (ignored for MySQL)`)
|
flag.StringVar(&schemaName, "schema", "public", `Database schema name. (default "public") (ignored for MySQL and MariaDB)`)
|
||||||
flag.StringVar(&sslmode, "sslmode", "disable", `Whether or not to use SSL(optional)(default "disable") (ignored for MySQL)`)
|
flag.StringVar(&sslmode, "sslmode", "disable", `Whether or not to use SSL(optional)(default "disable") (ignored for MySQL and MariaDB)`)
|
||||||
|
|
||||||
flag.StringVar(&destDir, "path", "", "Destination dir for files generated.")
|
flag.StringVar(&destDir, "path", "", "Destination dir for files generated.")
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ Jet generator 2.0.0
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
-source string
|
-source string
|
||||||
Database system name (PostgreSQL or MySQL)
|
Database system name (PostgreSQL, MySQL or MariaDB)
|
||||||
-host string
|
-host string
|
||||||
Database host path (Example: localhost)
|
Database host path (Example: localhost)
|
||||||
-port int
|
-port int
|
||||||
|
|
@ -65,9 +65,9 @@ Usage:
|
||||||
-params string
|
-params string
|
||||||
Additional connection string parameters(optional)
|
Additional connection string parameters(optional)
|
||||||
-schema string
|
-schema string
|
||||||
Database schema name. (default "public") (ignored for MySQL)
|
Database schema name. (default "public") (ignored for MySQL and MariaDB)
|
||||||
-sslmode string
|
-sslmode string
|
||||||
Whether or not to use SSL(optional) (default "disable") (ignored for MySQL)
|
Whether or not to use SSL(optional) (default "disable") (ignored for MySQL and MariaDB)
|
||||||
-path string
|
-path string
|
||||||
Destination dir for files generated.
|
Destination dir for files generated.
|
||||||
`)
|
`)
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,7 @@ func initMySQLDB() {
|
||||||
Port: dbconfig.MySQLPort,
|
Port: dbconfig.MySQLPort,
|
||||||
User: dbconfig.MySQLUser,
|
User: dbconfig.MySQLUser,
|
||||||
Password: dbconfig.MySQLPassword,
|
Password: dbconfig.MySQLPassword,
|
||||||
//SslMode:
|
DBName: dbName,
|
||||||
//Params
|
|
||||||
DBName: dbName,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
panicOnError(err)
|
panicOnError(err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue