@@ -45,17 +45,31 @@ PSQL_DSN="postgres://user:pass@host:port/dbname?sslmode=disable"
45
45
46
46
The values that exist for the drivers:
47
47
48
- | Name | Description | Default |
49
- | ---------------| ---------------------------------------| --------------------------|
50
- | dsn | URL to connect to | |
51
- | schemas | Schemas find tables in | [ "public"] |
52
- | shared_schema | Schema to not include prefix in model | first value in "schemas" |
53
- | output | Folder for generated files | "models" |
54
- | pkgname | Package name for generated code | "models" |
55
- | uuid_pkg | UUID package to use (gofrs or google) | "gofrs" |
56
- | concurrency | How many tables to fetch in parallel | 10 |
57
- | only | Only generate these | |
58
- | except | Skip generation for these | |
48
+ | Name | Description | Default |
49
+ | ---------------| ---------------------------------------------------| --------------------------|
50
+ | dsn | URL to connect to | |
51
+ | driver_name | Driver to use for generating driver-specific code | ` github.com/lib/pq ` |
52
+ | schemas | Schemas find tables in | [ "public"] |
53
+ | shared_schema | Schema to not include prefix in model | first value in "schemas" |
54
+ | output | Folder for generated files | "models" |
55
+ | pkgname | Package name for generated code | "models" |
56
+ | uuid_pkg | UUID package to use (gofrs or google) | "gofrs" |
57
+ | concurrency | How many tables to fetch in parallel | 10 |
58
+ | only | Only generate these | |
59
+ | except | Skip generation for these | |
60
+
61
+ ## Driver-specific code
62
+
63
+ The ` driver_name ` configuration option enables Bob to generate code that is tailored to the specifics of the selected ` database/sql ` driver.
64
+
65
+ For Postgres, the supported drivers are:
66
+
67
+ - [ github.com/lib/pq] ( https://pkg.go.dev/github.com/lib/pq ) (default)
68
+ - [ github.com/jackc/pgx] ( https://pkg.go.dev/github.com/jackc/pgx )
69
+ - [ github.com/jackc/pgx/v4] ( https://pkg.go.dev/github.com/jackc/pgx/v4 )
70
+ - [ github.com/jackc/pgx/v5] ( https://pkg.go.dev/github.com/jackc/pgx/v5 )
71
+
72
+ Bob leverages driver-specific code to perform precise error matching for [ generated error constants] ( ./usage#generated-error-constants ) .
59
73
60
74
## Only/Except:
61
75
0 commit comments