Skip to content

Commit 6c419b9

Browse files
committed
feat: Support generating function comments
1 parent 54496e9 commit 6c419b9

File tree

11 files changed

+88
-17
lines changed

11 files changed

+88
-17
lines changed

examples/authors/mysql/query.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SELECT * FROM authors
77
ORDER BY name;
88

99
/* name: CreateAuthor :exec */
10+
/* Create a new author. */
1011
INSERT INTO authors (
1112
name, bio
1213
) VALUES (

examples/authors/postgresql/query.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ SELECT * FROM authors
77
ORDER BY name;
88

99
-- name: CreateAuthor :one
10+
-- Create a new author.
11+
-- This is the second line.*/
12+
--/This is the third line.
1013
INSERT INTO authors (
1114
name, bio
1215
) VALUES (

examples/authors/sqlite/query.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SELECT * FROM authors
77
ORDER BY name;
88

99
-- name: CreateAuthor :exec
10+
-- Create a new author.
1011
INSERT INTO authors (
1112
name, bio
1213
) VALUES (

examples/bun-mysql2/src/db/query_sql.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export interface CreateAuthorArgs {
7272
bio: string | null;
7373
}
7474

75+
/**
76+
* Create a new author.
77+
*/
7578
export async function createAuthor(client: Client, args: CreateAuthorArgs): Promise<void> {
7679
await client.query({
7780
sql: createAuthorQuery,

examples/bun-pg/src/db/query_sql.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export interface CreateAuthorRow {
8181
bio: string | null;
8282
}
8383

84+
/**
85+
* Create a new author.
86+
* This is the second line.*\/
87+
*\/This is the third line.
88+
*/
8489
export async function createAuthor(client: Client, args: CreateAuthorArgs): Promise<CreateAuthorRow | null> {
8590
const result = await client.query({
8691
text: createAuthorQuery,

examples/bun-postgres/src/db/query_sql.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export interface CreateAuthorRow {
6969
bio: string | null;
7070
}
7171

72+
/**
73+
* Create a new author.
74+
* This is the second line.*\/
75+
*\/This is the third line.
76+
*/
7277
export async function createAuthor(sql: Sql, args: CreateAuthorArgs): Promise<CreateAuthorRow | null> {
7378
const rows = await sql.unsafe(createAuthorQuery, [args.name, args.bio]).values();
7479
if (rows.length !== 1) {

examples/node-better-sqlite3/src/db/query_sql.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export interface CreateAuthorArgs {
5353
bio: any | null;
5454
}
5555

56+
/**
57+
* Create a new author.
58+
*/
5659
export async function createAuthor(database: Database, args: CreateAuthorArgs): Promise<void> {
5760
const stmt = database.prepare(createAuthorQuery);
5861
await stmt.run(args.name, args.bio);

examples/node-mysql2/src/db/query_sql.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export interface CreateAuthorArgs {
7272
bio: string | null;
7373
}
7474

75+
/**
76+
* Create a new author.
77+
*/
7578
export async function createAuthor(client: Client, args: CreateAuthorArgs): Promise<void> {
7679
await client.query({
7780
sql: createAuthorQuery,

examples/node-pg/src/db/query_sql.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export interface CreateAuthorRow {
8181
bio: string | null;
8282
}
8383

84+
/**
85+
* Create a new author.
86+
* This is the second line.*\/
87+
*\/This is the third line.
88+
*/
8489
export async function createAuthor(client: Client, args: CreateAuthorArgs): Promise<CreateAuthorRow | null> {
8590
const result = await client.query({
8691
text: createAuthorQuery,

examples/node-postgres/src/db/query_sql.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export interface CreateAuthorRow {
6969
bio: string | null;
7070
}
7171

72+
/**
73+
* Create a new author.
74+
* This is the second line.*\/
75+
*\/This is the third line.
76+
*/
7277
export async function createAuthor(sql: Sql, args: CreateAuthorArgs): Promise<CreateAuthorRow | null> {
7378
const rows = await sql.unsafe(createAuthorQuery, [args.name, args.bio]).values();
7479
if (rows.length !== 1) {

0 commit comments

Comments
 (0)