diff --git a/examples/bun-mysql2/src/db/query_sql.ts b/examples/bun-mysql2/src/db/query_sql.ts index 1673007..a3e0b32 100644 --- a/examples/bun-mysql2/src/db/query_sql.ts +++ b/examples/bun-mysql2/src/db/query_sql.ts @@ -4,7 +4,7 @@ import mysql, { RowDataPacket, ResultSetHeader } from "mysql2/promise"; type Client = mysql.Connection | mysql.Pool; -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = ? LIMIT 1`; @@ -35,7 +35,7 @@ export async function getAuthor(client: Client, args: GetAuthorArgs): Promise { }); } -export const createAuthorQuery = `-- name: CreateAuthor :exec +const createAuthorQuery = `-- name: CreateAuthor :exec INSERT INTO authors ( name, bio ) VALUES ( @@ -79,7 +79,7 @@ export async function createAuthor(client: Client, args: CreateAuthorArgs): Prom }); } -export const createAuthorReturnIdQuery = `-- name: CreateAuthorReturnId :execlastid +const createAuthorReturnIdQuery = `-- name: CreateAuthorReturnId :execlastid INSERT INTO authors ( name, bio ) VALUES ( @@ -99,7 +99,7 @@ export async function createAuthorReturnId(client: Client, args: CreateAuthorRet return result?.insertId ?? 0; } -export const deleteAuthorQuery = `-- name: DeleteAuthor :exec +const deleteAuthorQuery = `-- name: DeleteAuthor :exec DELETE FROM authors WHERE id = ?`; @@ -114,7 +114,7 @@ export async function deleteAuthor(client: Client, args: DeleteAuthorArgs): Prom }); } -export const testQuery = `-- name: Test :one +const testQuery = `-- name: Test :one SELECT c_bit, c_tinyint, c_bool, c_boolean, c_smallint, c_mediumint, c_int, c_integer, c_bigint, c_serial, c_decimal, c_dec, c_numeric, c_fixed, c_float, c_double, c_double_precision, c_date, c_time, c_datetime, c_timestamp, c_year, c_char, c_nchar, c_national_char, c_varchar, c_binary, c_varbinary, c_tinyblob, c_tinytext, c_blob, c_text, c_mediumblob, c_mediumtext, c_longblob, c_longtext, c_json FROM node_mysql_types LIMIT 1`; diff --git a/examples/bun-pg/src/db/query_sql.ts b/examples/bun-pg/src/db/query_sql.ts index 2e8db52..789138e 100644 --- a/examples/bun-pg/src/db/query_sql.ts +++ b/examples/bun-pg/src/db/query_sql.ts @@ -6,7 +6,7 @@ interface Client { query: (config: QueryArrayConfig) => Promise; } -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = $1 LIMIT 1`; @@ -37,7 +37,7 @@ export async function getAuthor(client: Client, args: GetAuthorArgs): Promise { }); } -export const createAuthorQuery = `-- name: CreateAuthor :one +const createAuthorQuery = `-- name: CreateAuthor :one INSERT INTO authors ( name, bio ) VALUES ( @@ -98,7 +98,7 @@ export async function createAuthor(client: Client, args: CreateAuthorArgs): Prom }; } -export const deleteAuthorQuery = `-- name: DeleteAuthor :exec +const deleteAuthorQuery = `-- name: DeleteAuthor :exec DELETE FROM authors WHERE id = $1`; diff --git a/examples/bun-postgres/src/db/query_sql.ts b/examples/bun-postgres/src/db/query_sql.ts index 8e15f3b..65f06c6 100644 --- a/examples/bun-postgres/src/db/query_sql.ts +++ b/examples/bun-postgres/src/db/query_sql.ts @@ -2,7 +2,7 @@ import { Sql } from "postgres"; -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = $1 LIMIT 1`; @@ -32,7 +32,7 @@ export async function getAuthor(sql: Sql, args: GetAuthorArgs): Promise { })); } -export const createAuthorQuery = `-- name: CreateAuthor :one +const createAuthorQuery = `-- name: CreateAuthor :one INSERT INTO authors ( name, bio ) VALUES ( @@ -85,7 +85,7 @@ export async function createAuthor(sql: Sql, args: CreateAuthorArgs): Promise return result as ListAuthorsRow[]; } -export const createAuthorQuery = `-- name: CreateAuthor :exec +const createAuthorQuery = `-- name: CreateAuthor :exec INSERT INTO authors ( name, bio ) VALUES ( @@ -58,7 +58,7 @@ export async function createAuthor(database: Database, args: CreateAuthorArgs): await stmt.run(args.name, args.bio); } -export const deleteAuthorQuery = `-- name: DeleteAuthor :exec +const deleteAuthorQuery = `-- name: DeleteAuthor :exec DELETE FROM authors WHERE id = ?`; diff --git a/examples/node-mysql2/src/db/query_sql.ts b/examples/node-mysql2/src/db/query_sql.ts index c79988f..a889f16 100644 --- a/examples/node-mysql2/src/db/query_sql.ts +++ b/examples/node-mysql2/src/db/query_sql.ts @@ -4,7 +4,7 @@ import mysql, { RowDataPacket, ResultSetHeader } from "mysql2/promise"; type Client = mysql.Connection | mysql.Pool; -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = ? LIMIT 1`; @@ -35,7 +35,7 @@ export async function getAuthor(client: Client, args: GetAuthorArgs): Promise { }); } -export const createAuthorQuery = `-- name: CreateAuthor :exec +const createAuthorQuery = `-- name: CreateAuthor :exec INSERT INTO authors ( name, bio ) VALUES ( @@ -79,7 +79,7 @@ export async function createAuthor(client: Client, args: CreateAuthorArgs): Prom }); } -export const createAuthorReturnIdQuery = `-- name: CreateAuthorReturnId :execlastid +const createAuthorReturnIdQuery = `-- name: CreateAuthorReturnId :execlastid INSERT INTO authors ( name, bio ) VALUES ( @@ -99,7 +99,7 @@ export async function createAuthorReturnId(client: Client, args: CreateAuthorRet return result?.insertId ?? 0; } -export const deleteAuthorQuery = `-- name: DeleteAuthor :exec +const deleteAuthorQuery = `-- name: DeleteAuthor :exec DELETE FROM authors WHERE id = ?`; @@ -114,7 +114,7 @@ export async function deleteAuthor(client: Client, args: DeleteAuthorArgs): Prom }); } -export const testQuery = `-- name: Test :one +const testQuery = `-- name: Test :one SELECT c_bit, c_tinyint, c_bool, c_boolean, c_smallint, c_mediumint, c_int, c_integer, c_bigint, c_serial, c_decimal, c_dec, c_numeric, c_fixed, c_float, c_double, c_double_precision, c_date, c_time, c_datetime, c_timestamp, c_year, c_char, c_nchar, c_national_char, c_varchar, c_binary, c_varbinary, c_tinyblob, c_tinytext, c_blob, c_text, c_mediumblob, c_mediumtext, c_longblob, c_longtext, c_json FROM node_mysql_types LIMIT 1`; diff --git a/examples/node-pg/src/db/query_sql.ts b/examples/node-pg/src/db/query_sql.ts index 2e8db52..789138e 100644 --- a/examples/node-pg/src/db/query_sql.ts +++ b/examples/node-pg/src/db/query_sql.ts @@ -6,7 +6,7 @@ interface Client { query: (config: QueryArrayConfig) => Promise; } -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = $1 LIMIT 1`; @@ -37,7 +37,7 @@ export async function getAuthor(client: Client, args: GetAuthorArgs): Promise { }); } -export const createAuthorQuery = `-- name: CreateAuthor :one +const createAuthorQuery = `-- name: CreateAuthor :one INSERT INTO authors ( name, bio ) VALUES ( @@ -98,7 +98,7 @@ export async function createAuthor(client: Client, args: CreateAuthorArgs): Prom }; } -export const deleteAuthorQuery = `-- name: DeleteAuthor :exec +const deleteAuthorQuery = `-- name: DeleteAuthor :exec DELETE FROM authors WHERE id = $1`; diff --git a/examples/node-postgres/src/db/query_sql.ts b/examples/node-postgres/src/db/query_sql.ts index 8e15f3b..65f06c6 100644 --- a/examples/node-postgres/src/db/query_sql.ts +++ b/examples/node-postgres/src/db/query_sql.ts @@ -2,7 +2,7 @@ import { Sql } from "postgres"; -export const getAuthorQuery = `-- name: GetAuthor :one +const getAuthorQuery = `-- name: GetAuthor :one SELECT id, name, bio FROM authors WHERE id = $1 LIMIT 1`; @@ -32,7 +32,7 @@ export async function getAuthor(sql: Sql, args: GetAuthorArgs): Promise { })); } -export const createAuthorQuery = `-- name: CreateAuthor :one +const createAuthorQuery = `-- name: CreateAuthor :one INSERT INTO authors ( name, bio ) VALUES ( @@ -85,7 +85,7 @@ export async function createAuthor(sql: Sql, args: CreateAuthorArgs): Promise