From c7f71c7e3ce39a7028546d322321f5cb82dc2ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 25 Aug 2025 12:37:34 +0200 Subject: [PATCH] Make `cmd/sqlc-export-schema` work again Make `cmd/sqlc-export-schema` work again, by having it look at the first schema it can find (instead of requiring that there is only one). --- cmd/sqlc-export-schema/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/sqlc-export-schema/main.go b/cmd/sqlc-export-schema/main.go index ba84a798..0d8a9b57 100644 --- a/cmd/sqlc-export-schema/main.go +++ b/cmd/sqlc-export-schema/main.go @@ -174,15 +174,15 @@ func schemaPathFromSqlcYAML() string { Msg("unexpected version in sqlc.yaml") } - if len(sqlcConfig.SQL) != 1 { + if len(sqlcConfig.SQL) == 0 { log.Fatal(). Int("sql items", len(sqlcConfig.SQL)). - Msg("sqlc.yaml should contain a single item in the 'sql' list") + Msg("sqlc.yaml should contain at least one item in the 'sql' list") } schema := sqlcConfig.SQL[0].Schema if schema == "" { - log.Fatal().Msg("sqlc.yaml should have a 'schema' key in the 'sql' item") + log.Fatal().Msg("sqlc.yaml should have a 'schema' key in the first 'sql' item") } return schema