From 94001bdea135a7fccd14fa66c0c6a10ea0728e58 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 8 Nov 2022 20:22:03 -0800 Subject: [PATCH] Port kotlin examples to sqlc-gen-kotlin (#1931) * Update sqlc.json * Development build * kotlin: Upgrade to v1.0.0 --- docs/guides/migrating-to-sqlc-gen-kotlin.md | 8 +- examples/kotlin/sqlc.json | 86 ++++++++++++++------- 2 files changed, 62 insertions(+), 32 deletions(-) diff --git a/docs/guides/migrating-to-sqlc-gen-kotlin.md b/docs/guides/migrating-to-sqlc-gen-kotlin.md index add5754e96..d47f9794e5 100644 --- a/docs/guides/migrating-to-sqlc-gen-kotlin.md +++ b/docs/guides/migrating-to-sqlc-gen-kotlin.md @@ -22,8 +22,8 @@ already. Add the following configuration for the plugin: { "name": "kt", "wasm": { - "url": "https://downloads.sqlc.dev/plugins/sqlc-gen-kotlin_0.16.0.wasm", - "sha256": "FIXME" + "url": "https://downloads.sqlc.dev/plugin/sqlc-gen-kotlin_1.0.0.wasm", + "sha256": "7620dc5d462de41fdc90e2011232c842117b416c98fd5c163d27c5738431a45c" } } ] @@ -35,8 +35,8 @@ version: "2" plugins: name: "kt" wasm: - url: "https://downloads.sqlc.dev/plugins/sqlc-gen-kotlin_0.16.0.wasm" - sha256: "FIXME" + url: "https://downloads.sqlc.dev/plugin/sqlc-gen-kotlin_1.0.0.wasm" + sha256: "7620dc5d462de41fdc90e2011232c842117b416c98fd5c163d27c5738431a45c" ``` ## Migrate each package diff --git a/examples/kotlin/sqlc.json b/examples/kotlin/sqlc.json index f7f8f0b61d..3113b7a246 100644 --- a/examples/kotlin/sqlc.json +++ b/examples/kotlin/sqlc.json @@ -1,82 +1,112 @@ { "version": "2", + "plugins": [ + { + "name": "kt", + "wasm": { + "url": "https://downloads.sqlc.dev/plugin/sqlc-gen-kotlin_1.0.0.wasm", + "sha256": "7620dc5d462de41fdc90e2011232c842117b416c98fd5c163d27c5738431a45c" + } + } + ], "sql": [ { "schema": "src/main/resources/authors/postgresql/schema.sql", "queries": "src/main/resources/authors/postgresql/query.sql", "engine": "postgresql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/authors/postgresql", - "package": "com.example.authors.postgresql" + "plugin": "kt", + "options": { + "package": "com.example.authors.postgresql" + } } - } + ] }, { "schema": "src/main/resources/ondeck/postgresql/schema", "queries": "src/main/resources/ondeck/postgresql/query", "engine": "postgresql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/ondeck/postgresql", - "package": "com.example.ondeck.postgresql" + "plugin": "kt", + "options": { + "package": "com.example.ondeck.postgresql" + } } - } + ] }, { "schema": "src/main/resources/jets/schema.sql", "queries": "src/main/resources/jets/query-building.sql", "engine": "postgresql", - "gen": { - "kotlin": { + "codegen": [ + { + "plugin": "kt", "out": "src/main/kotlin/com/example/jets", - "package": "com.example.jets" + "options": { + "package": "com.example.jets" + } } - } + ] }, { "schema": "src/main/resources/booktest/postgresql/schema.sql", "queries": "src/main/resources/booktest/postgresql/query.sql", "engine": "postgresql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/booktest/postgresql", - "package": "com.example.booktest.postgresql" + "plugin": "kt", + "options": { + "package": "com.example.booktest.postgresql" + } } - } + ] }, { "schema": "src/main/resources/authors/mysql/schema.sql", "queries": "src/main/resources/authors/mysql/query.sql", "engine": "mysql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/authors/mysql", - "package": "com.example.authors.mysql" + "plugin": "kt", + "options": { + "package": "com.example.authors.mysql" + } } - } + ] }, { "schema": "src/main/resources/booktest/mysql/schema.sql", "queries": "src/main/resources/booktest/mysql/query.sql", "engine": "mysql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/booktest/mysql", - "package": "com.example.booktest.mysql" + "plugin": "kt", + "options": { + "package": "com.example.booktest.mysql" + } } - } + ] }, { "schema": "src/main/resources/ondeck/mysql/schema", "queries": "src/main/resources/ondeck/mysql/query", "engine": "mysql", - "gen": { - "kotlin": { + "codegen": [ + { "out": "src/main/kotlin/com/example/ondeck/mysql", - "package": "com.example.ondeck.mysql" + "plugin": "kt", + "options": { + "package": "com.example.ondeck.mysql" + } } - } + ] } ] }