-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
124 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
export type FunctionAssignParams = []; | ||
|
||
|
||
export interface IFunctionAssignResult { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface IFunctionAssignQuery { | ||
params: FunctionAssignParams; | ||
result: IFunctionAssignResult; | ||
}; | ||
|
||
|
||
|
||
|
||
export type ReturnQueryParams = []; | ||
|
||
|
||
export interface IReturnQueryResult { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface IReturnQueryQuery { | ||
params: ReturnQueryParams; | ||
result: IReturnQueryResult; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { sql } from 'sqlx-ts' | ||
|
||
function test() { | ||
const functionAssign = sql`SELECT id FROM items` | ||
|
||
return sql` | ||
-- @name: return query | ||
SELECT id FROM items | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
export type IfstmtParams = []; | ||
|
||
|
||
export interface IIfstmtResult { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface IIfstmtQuery { | ||
params: IfstmtParams; | ||
result: IIfstmtResult; | ||
}; | ||
|
||
|
||
|
||
|
||
export type NestedIfStmtParams = []; | ||
|
||
|
||
export interface INestedIfStmtResult { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface INestedIfStmtQuery { | ||
params: NestedIfStmtParams; | ||
result: INestedIfStmtResult; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { sql } from 'sqlx-ts' | ||
|
||
if (true) { | ||
const ifstmt = sql`SELECT id FROM items;`; | ||
} | ||
|
||
function testIfStatement() { | ||
if (true) { | ||
const nestedIfStmt = sql`SELECT id FROM items;`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
export type Case1Params = []; | ||
|
||
|
||
export interface ICase1Result { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface ICase1Query { | ||
params: Case1Params; | ||
result: ICase1Result; | ||
}; | ||
|
||
|
||
|
||
|
||
export type Case2Params = []; | ||
|
||
|
||
export interface ICase2Result { | ||
id: number; | ||
}; | ||
|
||
|
||
export interface ICase2Query { | ||
params: Case2Params; | ||
result: ICase2Result; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { sql } from 'sqlx-ts' | ||
|
||
|
||
switch (true) { | ||
case true: | ||
const case1 = sql`SELECT id FROM items`; | ||
break; | ||
default: | ||
const case2 = sql`SELECT id FROM items`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters