Skip to content

Commit

Permalink
Merge pull request #227 from YvanDaSilva/sqlc-fix
Browse files Browse the repository at this point in the history
sqlc: remove wrong unique schema.sql.rules check
  • Loading branch information
Peefy authored Aug 31, 2024
2 parents 16eab4e + 3767b68 commit 0dd55d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
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

0 comments on commit 0dd55d9

Please sign in to comment.