-
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
23 changed files
with
187 additions
and
142 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
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 |
---|---|---|
@@ -1,7 +1,66 @@ | ||
{ | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"extends": [ | ||
"canonical", | ||
"canonical/flowtype" | ||
"canonical/typescript" | ||
], | ||
"root": true | ||
"ignorePatterns": [ | ||
"dist", | ||
"node_modules", | ||
"coverage" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": "*.d.ts", | ||
"rules": { | ||
"filenames/match-regex": 0, | ||
"import/no-default-export": 0, | ||
"import/unambiguous": 0 | ||
} | ||
} | ||
], | ||
"root": true, | ||
"rules": { | ||
"@typescript-eslint/ban-ts-comment": 0, | ||
"@typescript-eslint/no-empty-function": 0, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-non-null-assertion": 1, | ||
"@typescript-eslint/no-unused-vars": 1, | ||
"@typescript-eslint/prefer-ts-expect-error": 1, | ||
"@typescript-eslint/array-type": 0, | ||
"@typescript-eslint/require-array-sort-compare": 0, | ||
"import/no-cycle": 0, | ||
"import/no-default-export": 0, | ||
"import/no-unresolved": 0, | ||
"linebreak-style": 0, | ||
"no-continue": 0, | ||
"no-extra-parens": 0, | ||
"no-restricted-syntax": 0, | ||
"no-undef": 0, | ||
"no-unused-expressions": [ | ||
2, | ||
{ | ||
"allowTaggedTemplates": true | ||
} | ||
], | ||
"no-unused-vars": 0, | ||
"object-curly-newline": [ | ||
2, | ||
{ | ||
"ExportDeclaration": { | ||
"minProperties": 1, | ||
"multiline": true | ||
}, | ||
"ImportDeclaration": { | ||
"minProperties": 1, | ||
"multiline": true | ||
} | ||
} | ||
], | ||
"require-await": 0, | ||
"unicorn/numeric-separators-style": 0, | ||
"unicorn/prevent-abbreviations": 0 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ test | |
coverage | ||
.* | ||
*.log | ||
!.flowconfig | ||
!.flowconfig |
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// @flow | ||
|
||
import Logger from 'roarr'; | ||
|
||
export default Logger.child({ | ||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
// @flow | ||
|
||
export { | ||
raw, | ||
} from './sqlTags'; |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
export { | ||
default as raw, | ||
} from './raw'; |
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import type { | ||
SqlSqlTokenType, | ||
ValueExpressionType, | ||
} from 'slonik'; | ||
import type { | ||
NamedParameterValuesType, | ||
} from '../types'; | ||
import { | ||
interpolatePositionalParameterReferences, | ||
interpolateNamedParameterReferences, | ||
} from '../utilities'; | ||
|
||
export default ( | ||
sql: string, | ||
values?: NamedParameterValuesType | ReadonlyArray<ValueExpressionType>, | ||
): SqlSqlTokenType => { | ||
if (Array.isArray(values)) { | ||
return interpolatePositionalParameterReferences(sql, values as ValueExpressionType[]); | ||
} else { | ||
return interpolateNamedParameterReferences(sql, values as NamedParameterValuesType); | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
// @flow | ||
|
||
import type { | ||
ValueExpressionType, | ||
createSqlTokenSqlFragment, | ||
} from 'slonik'; | ||
|
||
export type NamedParameterValuesType = { | ||
[key: string]: ValueExpressionType, | ||
... | ||
}; | ||
|
||
export type PositionalParameterValuesType = $ReadOnlyArray<ValueExpressionType>; | ||
export type PrimitiveValueExpressionType = ReturnType<typeof createSqlTokenSqlFragment>['values'][number]; |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
export { | ||
default as interpolateNamedParameterReferences, | ||
} from './interpolateNamedParameterReferences'; | ||
export { | ||
default as interpolatePositionalParameterReferences, | ||
} from './interpolatePositionalParameterReferences'; |
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
Oops, something went wrong.