Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlc: add support for 'sql_driver' go gen option #229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlc/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "sqlc"
edition = "v0.9.0"
version = "0.0.3"
version = "0.0.4"
description = "sqlc.dev schema config file"
4 changes: 4 additions & 0 deletions sqlc/sqlc.k
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ schema GoGen:
# Either `pgx/v4`, `pgx/v5` or `database/sql`.
# Defaults to database/sql.
sql_package: "database/sql" | "pgx/v4" | "pgx/v5" = "database/sql"
# One of the following drivers are allowed, the default value will depend on the sql_package
# and is handled by sqlc behavior:
# "github.com/jackc/pgx/v4" | "github.com/jackc/pgx/v5" | "github.com/lib/pq" | "github.com/go-sql-driver/mysql"
sql_driver?: "github.com/jackc/pgx/v4" | "github.com/jackc/pgx/v5" | "github.com/lib/pq" | "github.com/go-sql-driver/mysql"
# If true, add DB tags to generated structs. Defaults to false.
emit_db_tags: bool = False
# If true, include support for prepared queries. Defaults to false.
Expand Down
1 change: 1 addition & 0 deletions sqlc/sqlc_test.k
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ sql:
out: "some/path"
omit_unused_structs: true
emit_sql_as_comment: true
sql_driver: "github.com/go-sql-driver/mysql"
- name: "test_two"
schema: "schema.sql"
queries: "query.sql"
Expand Down
Loading