Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gajus/slonik
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v33.1.2
Choose a base ref
...
head repository: gajus/slonik
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v33.1.3
Choose a head ref
  • 3 commits
  • 130 files changed
  • 1 contributor

Commits on Mar 20, 2023

  1. style: apply prettier

    gajus committed Mar 20, 2023
    Copy the full SHA
    962da4a View commit details
  2. fix: apply canonical/auto

    gajus committed Mar 20, 2023
    Copy the full SHA
    5fa943b View commit details
  3. Copy the full SHA
    dc9599a View commit details
Showing with 5,701 additions and 5,016 deletions.
  1. +2 −26 .eslintrc
  2. +43 −43 .github/workflows/feature.yaml
  3. +53 −53 .github/workflows/main.yaml
  4. +1 −3 .ncurc.js
  5. +7 −20 ava.config.js
  6. +3,192 −1,917 package-lock.json
  7. +9 −9 package.json
  8. +1 −3 src/Logger.ts
  9. +63 −54 src/QueryStream.ts
  10. +30 −84 src/binders/bindPool.ts
  11. +9 −51 src/binders/bindPoolConnection.ts
  12. +11 −55 src/binders/bindTransactionConnection.ts
  13. +3 −9 src/binders/index.ts
  14. +17 −13 src/connectionMethods/any.ts
  15. +25 −18 src/connectionMethods/anyFirst.ts
  16. +5 −15 src/connectionMethods/copyFromBinary.ts
  17. +18 −20 src/connectionMethods/exists.ts
  18. +14 −42 src/connectionMethods/index.ts
  19. +24 −19 src/connectionMethods/many.ts
  20. +31 −21 src/connectionMethods/manyFirst.ts
  21. +24 −19 src/connectionMethods/maybeOne.ts
  22. +17 −16 src/connectionMethods/maybeOneFirst.ts
  23. +69 −41 src/connectionMethods/nestedTransaction.ts
  24. +30 −23 src/connectionMethods/one.ts
  25. +17 −16 src/connectionMethods/oneFirst.ts
  26. +8 −11 src/connectionMethods/query.ts
  27. +43 −30 src/connectionMethods/stream.ts
  28. +75 −46 src/connectionMethods/transaction.ts
  29. +10 −8 src/declarations.d.ts
  30. +28 −20 src/errors.ts
  31. +9 −9 src/factories/createClientConfiguration.ts
  32. +29 −38 src/factories/createConnection.ts
  33. +11 −23 src/factories/createMockPool.ts
  34. +4 −5 src/factories/createMockQueryResult.ts
  35. +59 −65 src/factories/createPool.ts
  36. +29 −21 src/factories/createPoolConfiguration.ts
  37. +25 −25 src/factories/createPrimitiveValueExpressions.ts
  38. +50 −61 src/factories/createSqlTag.ts
  39. +7 −9 src/factories/createSqlTokenSqlFragment.ts
  40. +1 −3 src/factories/createTypeParserPreset.ts
  41. +8 −24 src/factories/index.ts
  42. +1 −3 src/factories/typeParsers/createBigintTypeParser.ts
  43. +1 −3 src/factories/typeParsers/createDateTypeParser.ts
  44. +4 −4 src/factories/typeParsers/createIntervalTypeParser.ts
  45. +1 −3 src/factories/typeParsers/createNumericTypeParser.ts
  46. +1 −3 src/factories/typeParsers/createTimestampTypeParser.ts
  47. +1 −3 src/factories/typeParsers/createTimestampWithTimeZoneTypeParser.ts
  48. +6 −18 src/factories/typeParsers/index.ts
  49. +30 −36 src/index.ts
  50. +14 −22 src/routines/createTypeOverrides.ts
  51. +90 −59 src/routines/executeQuery.ts
  52. +2 −6 src/routines/index.ts
  53. +24 −20 src/sqlFragmentFactories/createArraySqlFragment.ts
  54. +7 −11 src/sqlFragmentFactories/createBinarySqlFragment.ts
  55. +10 −12 src/sqlFragmentFactories/createDateSqlFragment.ts
  56. +15 −12 src/sqlFragmentFactories/createFragmentSqlFragment.ts
  57. +9 −12 src/sqlFragmentFactories/createIdentifierSqlFragment.ts
  58. +3 −10 src/sqlFragmentFactories/createIntervalSqlFragment.ts
  59. +34 −31 src/sqlFragmentFactories/createJsonSqlFragment.ts
  60. +6 −10 src/sqlFragmentFactories/createListSqlFragment.ts
  61. +15 −12 src/sqlFragmentFactories/createQuerySqlFragment.ts
  62. +10 −12 src/sqlFragmentFactories/createTimestampSqlFragment.ts
  63. +39 −26 src/sqlFragmentFactories/createUnnestSqlFragment.ts
  64. +11 −33 src/sqlFragmentFactories/index.ts
  65. +18 −25 src/state.ts
  66. +2 −1 src/tokens.ts
  67. +212 −190 src/types.ts
  68. +2 −6 src/utilities/createQueryId.ts
  69. +1 −3 src/utilities/createUid.ts
  70. +6 −10 src/utilities/encodeTupleList.ts
  71. +1 −1 src/utilities/escapeIdentifier.ts
  72. +3 −3 src/utilities/escapeLiteralValue.ts
  73. +13 −39 src/utilities/index.ts
  74. +9 −2 src/utilities/isPrimitiveValueExpression.ts
  75. +6 −10 src/utilities/isSqlToken.ts
  76. +12 −13 src/utilities/parseDsn.ts
  77. +5 −7 src/utilities/safeStringify.ts
  78. +4 −4 src/utilities/sanitizeObject.ts
  79. +10 −30 src/utilities/stringifyDsn.ts
  80. +1 −3 test/helpers/Logger.ts
  81. +1 −3 test/helpers/createClientConfiguration.ts
  82. +1 −3 test/helpers/createConnectionContext.ts
  83. +174 −147 test/helpers/createIntegrationTests.ts
  84. +22 −32 test/helpers/createPool.ts
  85. +1 −3 test/helpers/createQueryContext.ts
  86. +22 −18 test/slonik/binders/bindPool/connect.ts
  87. +7 −10 test/slonik/binders/bindPool/interceptors/afterPoolConnection.ts
  88. +1 −3 test/slonik/binders/bindPool/interceptors/beforePoolConnection.ts
  89. +40 −33 test/slonik/binders/bindPool/transaction.ts
  90. +4 −13 test/slonik/connectionMethods/anyFirst.ts
  91. +3 −9 test/slonik/connectionMethods/many.ts
  92. +4 −14 test/slonik/connectionMethods/manyFirst.ts
  93. +3 −9 test/slonik/connectionMethods/maybeOne.ts
  94. +3 −9 test/slonik/connectionMethods/maybeOneFirst.ts
  95. +44 −28 test/slonik/connectionMethods/nestedTransaction.ts
  96. +6 −17 test/slonik/connectionMethods/one.ts
  97. +5 −13 test/slonik/connectionMethods/oneFirst.ts
  98. +2 −6 test/slonik/connectionMethods/query/interceptors/beforeQueryExecution.ts
  99. +2 −6 test/slonik/connectionMethods/query/interceptors/transformQuery.ts
  100. +2 −6 test/slonik/connectionMethods/query/interceptors/transformRow.ts
  101. +19 −28 test/slonik/connectionMethods/query/query.ts
  102. +16 −16 test/slonik/connectionMethods/transaction.ts
  103. +5 −2 test/slonik/errors.ts
  104. +4 −12 test/slonik/factories/createClientConfiguration.ts
  105. +7 −22 test/slonik/factories/createMockPool.ts
  106. +86 −82 test/slonik/integration/pg.ts
  107. +6 −15 test/slonik/integration/postgres.ts
  108. +52 −62 test/slonik/routines/executeQuery.ts
  109. +36 −68 test/slonik/templateTags/sql/array.ts
  110. +6 −10 test/slonik/templateTags/sql/date.ts
  111. +5 −15 test/slonik/templateTags/sql/identifier.ts
  112. +3 −14 test/slonik/templateTags/sql/interval.ts
  113. +35 −78 test/slonik/templateTags/sql/join.ts
  114. +15 −30 test/slonik/templateTags/sql/json.ts
  115. +15 −30 test/slonik/templateTags/sql/jsonb.ts
  116. +6 −8 test/slonik/templateTags/sql/literalValue.ts
  117. +9 −28 test/slonik/templateTags/sql/sql.ts
  118. +10 −11 test/slonik/templateTags/sql/timestamp.ts
  119. +2 −6 test/slonik/templateTags/sql/type.ts
  120. +5 −13 test/slonik/templateTags/sql/typeAlias.ts
  121. +75 −207 test/slonik/templateTags/sql/unnest.ts
  122. +1 −3 test/slonik/utilities/countArrayDimensions.ts
  123. +1 −3 test/slonik/utilities/escapeIdentifier.ts
  124. +4 −6 test/slonik/utilities/escapeLiteralValue.ts
  125. +12 −12 test/slonik/utilities/parseDsn.ts
  126. +1 −4 test/slonik/utilities/stringifyDsn.ts
  127. +1 −3 test/slonik/utilities/stripArrayNotation.ts
  128. +25 −22 test/types.ts
  129. +4 −4 tsconfig.json
  130. +138 −124 types/pg.d.ts
28 changes: 2 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
{
"extends": "canonical/auto",
"ignorePatterns": [
"package-lock.json"
],
"overrides": [
{
"extends": [
"canonical",
"canonical/node"
],
"files": "*.js",
"rules": {
"unicorn/prevent-abbreviations": 0
}
},
{
"files": "*.d.ts",
"rules": {
"filenames/match-regex": 0
}
},
{
"extends": [
"canonical",
"canonical/typescript"
],
"files": "*.ts",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/no-unnecessary-condition": 0,
"require-atomic-updates": 0,
"unicorn/prevent-abbreviations": 0
"import/no-cycle": 0
}
}
],
86 changes: 43 additions & 43 deletions .github/workflows/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
jobs:
lint:
runs-on: ubuntu-latest
build:
environment: release
name: Lint
name: Build
runs-on: ubuntu-latest
steps:
- name: setup repository
uses: actions/checkout@v2
@@ -11,15 +11,15 @@ jobs:
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run lint
- run: npm run build
timeout-minutes: 10
build:
runs-on: ubuntu-latest
lint:
environment: release
name: Build
name: Lint
runs-on: ubuntu-latest
steps:
- name: setup repository
uses: actions/checkout@v2
@@ -28,17 +28,17 @@ jobs:
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run build
- run: npm run lint
timeout-minutes: 10
test:
env:
TEST_ONLY_NON_INTEGRATION: 'true'
runs-on: ubuntu-latest
environment: release
name: Test
runs-on: ubuntu-latest
steps:
- name: setup repository
uses: actions/checkout@v2
@@ -47,31 +47,31 @@ jobs:
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run test
timeout-minutes: 10
test-pg-integration:
env:
TEST_ONLY_PG_INTEGRATION: 'true'
environment: release
name: Test "pg" integration
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
environment: release
name: Test "pg" integration
ports:
- 5432:5432
steps:
- name: setup repository
uses: actions/checkout@v2
@@ -80,33 +80,33 @@ jobs:
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run test
env:
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
timeout-minutes: 10
test-postgres-integration:
env:
TEST_ONLY_POSTGRES_INTEGRATION: 'true'
environment: release
name: Test "postgres" integration
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
image: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
environment: release
name: Test "postgres" integration
ports:
- 5432:5432
steps:
- name: setup repository
uses: actions/checkout@v2
@@ -115,25 +115,25 @@ jobs:
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "18"
cache: "npm"
cache: 'npm'
node-version: '18'
- run: npm ci
- run: npm run test
env:
- env:
POSTGRES_DSN: postgres:postgres@localhost:5432
run: npm run test
timeout-minutes: 10
name: Test and build
on:
pull_request:
branches:
- main
paths-ignore:
- ".editorconfig"
- ".husky/**"
- ".lintstagedrc.js"
- ".mergify.yml"
- ".nvmrc"
- "README.md"
- '.editorconfig'
- '.husky/**'
- '.lintstagedrc.js'
- '.mergify.yml'
- '.nvmrc'
- 'README.md'
types:
- opened
- synchronize
Loading