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: remove wrong unique schema.sql.rules check #227

Merged
merged 2 commits into from
Aug 31, 2024
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.2"
version = "0.0.3"
description = "sqlc.dev schema config file"
2 changes: 0 additions & 2 deletions sqlc/sqlc.k
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ schema ConfigSchema:
}

check:
# schema.sql.rules should be unique
isunique(allSqlRules()), "sql.rules must be unique"
# schema.[rulees].name should be unique
isunique(allRuleNames()) if $rules, "rules must be unique"
# schema.sql.[rules] need to be present in base schema.[rules].name
Expand Down
12 changes: 12 additions & 0 deletions sqlc/sqlc_test.k
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,18 @@ sql:
out: "some/path"
omit_unused_structs: true
emit_sql_as_comment: true
- name: "test_two"
schema: "schema.sql"
queries: "query.sql"
engine: "mysql"
rules:
- no-exec-q-annotation
gen:
go:
package: "somegopkgtwo"
out: "some/pathtwo"
omit_unused_structs: true
emit_sql_as_comment: true
"""
cfg :ConfigSchema = yaml.decode(yl)
assert len(cfg.$rules) == 1
Expand Down
Loading