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.3.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.3.3
Choose a head ref
  • 6 commits
  • 51 files changed
  • 1 contributor

Commits on Jun 7, 2023

  1. Copy the full SHA
    894bfd5 View commit details
  2. Copy the full SHA
    a3a56fb View commit details
  3. Copy the full SHA
    14d2446 View commit details
  4. Copy the full SHA
    098562a View commit details
  5. Copy the full SHA
    2636679 View commit details
  6. fix: correct import paths

    gajus committed Jun 7, 2023
    Copy the full SHA
    5670aa2 View commit details
Showing with 184 additions and 299 deletions.
  1. +7 −93 package-lock.json
  2. +0 −2 package.json
  3. +2 −2 src/binders/bindPool.ts
  4. +13 −15 src/binders/bindPoolConnection.ts
  5. +12 −14 src/binders/bindTransactionConnection.ts
  6. +0 −3 src/binders/index.ts
  7. +1 −1 src/connectionMethods/any.ts
  8. +1 −1 src/connectionMethods/anyFirst.ts
  9. +2 −2 src/connectionMethods/copyFromBinary.ts
  10. +1 −1 src/connectionMethods/exists.ts
  11. +0 −14 src/connectionMethods/index.ts
  12. +1 −1 src/connectionMethods/many.ts
  13. +1 −1 src/connectionMethods/manyFirst.ts
  14. +1 −1 src/connectionMethods/maybeOne.ts
  15. +1 −1 src/connectionMethods/maybeOneFirst.ts
  16. +2 −2 src/connectionMethods/nestedTransaction.ts
  17. +1 −1 src/connectionMethods/one.ts
  18. +1 −1 src/connectionMethods/oneFirst.ts
  19. +1 −1 src/connectionMethods/query.ts
  20. +1 −1 src/connectionMethods/stream.ts
  21. +2 −2 src/connectionMethods/transaction.ts
  22. +0 −10 src/declarations.d.ts
  23. +2 −2 src/factories/createConnection.ts
  24. +1 −1 src/factories/createMockPool.ts
  25. +2 −2 src/factories/createPool.ts
  26. +1 −1 src/factories/createPoolConfiguration.ts
  27. +1 −1 src/factories/createPrimitiveValueExpressions.ts
  28. +4 −6 src/factories/createSqlTag.ts
  29. +11 −13 src/factories/createSqlTokenSqlFragment.ts
  30. +6 −8 src/factories/createTypeParserPreset.ts
  31. +0 −8 src/factories/index.ts
  32. +0 −6 src/factories/typeParsers/index.ts
  33. +16 −11 src/index.ts
  34. +6 −17 src/routines/executeQuery.ts
  35. +0 −2 src/routines/index.ts
  36. +4 −6 src/sqlFragmentFactories/createArraySqlFragment.ts
  37. +1 −1 src/sqlFragmentFactories/createIdentifierSqlFragment.ts
  38. +2 −2 src/sqlFragmentFactories/createJsonSqlFragment.ts
  39. +4 −5 src/sqlFragmentFactories/createListSqlFragment.ts
  40. +4 −6 src/sqlFragmentFactories/createUnnestSqlFragment.ts
  41. +0 −11 src/sqlFragmentFactories/index.ts
  42. +2 −2 src/types.ts
  43. +30 −0 src/utilities/getStackTrace.ts
  44. +0 −13 src/utilities/index.ts
  45. +14 −0 src/utilities/isPlainObject.ts
  46. +1 −1 test/slonik/errors.ts
  47. +1 −1 test/slonik/utilities/escapeIdentifier.ts
  48. +1 −1 test/slonik/utilities/escapeLiteralValue.ts
  49. +16 −0 test/slonik/utilities/getStackTrace.ts
  50. +1 −1 test/slonik/utilities/parseDsn.ts
  51. +2 −1 test/slonik/utilities/stringifyDsn.ts
100 changes: 7 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@
"@types/pg": "^8.10.1",
"concat-stream": "^2.0.0",
"es6-error": "^4.1.1",
"get-stack-trace": "^2.1.1",
"is-plain-object": "^5.0.0",
"iso8601-duration": "^1.3.0",
"p-defer": "^3.0.0",
"pg": "^8.11.0",
4 changes: 2 additions & 2 deletions src/binders/bindPool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { transaction } from '../connectionMethods';
import { createConnection } from '../factories';
import { transaction } from '../connectionMethods/transaction';
import { createConnection } from '../factories/createConnection';
import { getPoolState } from '../state';
import {
type ClientConfiguration,
28 changes: 13 additions & 15 deletions src/binders/bindPoolConnection.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import {
any,
anyFirst,
copyFromBinary,
exists,
many,
manyFirst,
maybeOne,
maybeOneFirst,
one,
oneFirst,
query as queryMethod,
stream,
transaction,
} from '../connectionMethods';
import { any } from '../connectionMethods/any';
import { anyFirst } from '../connectionMethods/anyFirst';
import { copyFromBinary } from '../connectionMethods/copyFromBinary';
import { exists } from '../connectionMethods/exists';
import { many } from '../connectionMethods/many';
import { manyFirst } from '../connectionMethods/manyFirst';
import { maybeOne } from '../connectionMethods/maybeOne';
import { maybeOneFirst } from '../connectionMethods/maybeOneFirst';
import { one } from '../connectionMethods/one';
import { oneFirst } from '../connectionMethods/oneFirst';
import { query as queryMethod } from '../connectionMethods/query';
import { stream } from '../connectionMethods/stream';
import { transaction } from '../connectionMethods/transaction';
import {
type ClientConfiguration,
type DatabasePoolConnection,
26 changes: 12 additions & 14 deletions src/binders/bindTransactionConnection.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import {
any,
anyFirst,
exists,
many,
manyFirst,
maybeOne,
maybeOneFirst,
nestedTransaction,
one,
oneFirst,
query as queryMethod,
stream,
} from '../connectionMethods';
import { any } from '../connectionMethods/any';
import { anyFirst } from '../connectionMethods/anyFirst';
import { exists } from '../connectionMethods/exists';
import { many } from '../connectionMethods/many';
import { manyFirst } from '../connectionMethods/manyFirst';
import { maybeOne } from '../connectionMethods/maybeOne';
import { maybeOneFirst } from '../connectionMethods/maybeOneFirst';
import { nestedTransaction } from '../connectionMethods/nestedTransaction';
import { one } from '../connectionMethods/one';
import { oneFirst } from '../connectionMethods/oneFirst';
import { query as queryMethod } from '../connectionMethods/query';
import { stream } from '../connectionMethods/stream';
import { getPoolClientState } from '../state';
import {
type ClientConfiguration,
3 changes: 0 additions & 3 deletions src/binders/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/connectionMethods/any.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { query } from './query';

/**
2 changes: 1 addition & 1 deletion src/connectionMethods/anyFirst.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { any } from './any';

export const anyFirst: InternalQueryMethod = async (
4 changes: 2 additions & 2 deletions src/connectionMethods/copyFromBinary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { executeQuery } from '../routines';
import { executeQuery } from '../routines/executeQuery';
import { type InternalCopyFromBinaryFunction } from '../types';
import { encodeTupleList } from '../utilities';
import { encodeTupleList } from '../utilities/encodeTupleList';
import { Duplex } from 'node:stream';
import { from } from 'pg-copy-streams';

2 changes: 1 addition & 1 deletion src/connectionMethods/exists.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError } from '../errors';
import { type InternalQueryMethod, type QuerySqlToken } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { query } from './query';

export const exists: InternalQueryMethod<Promise<boolean>> = async (
14 changes: 0 additions & 14 deletions src/connectionMethods/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/connectionMethods/many.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NotFoundError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { query } from './query';

/**
2 changes: 1 addition & 1 deletion src/connectionMethods/manyFirst.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { many } from './many';

export const manyFirst: InternalQueryMethod = async (
2 changes: 1 addition & 1 deletion src/connectionMethods/maybeOne.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { query } from './query';

/**
2 changes: 1 addition & 1 deletion src/connectionMethods/maybeOneFirst.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { maybeOne } from './maybeOne';

/**
4 changes: 2 additions & 2 deletions src/connectionMethods/nestedTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { bindTransactionConnection } from '../binders';
import { bindTransactionConnection } from '../binders/bindTransactionConnection';
import { TRANSACTION_ROLLBACK_ERROR_PREFIX } from '../constants';
import { getPoolClientState } from '../state';
import { type InternalNestedTransactionFunction } from '../types';
import { createUid } from '../utilities';
import { createUid } from '../utilities/createUid';
import { serializeError } from 'serialize-error';

const execNestedTransaction: InternalNestedTransactionFunction = async (
2 changes: 1 addition & 1 deletion src/connectionMethods/one.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataIntegrityError, NotFoundError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { query } from './query';

/**
2 changes: 1 addition & 1 deletion src/connectionMethods/oneFirst.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UnexpectedStateError } from '../errors';
import { type InternalQueryMethod } from '../types';
import { createQueryId } from '../utilities';
import { createQueryId } from '../utilities/createQueryId';
import { one } from './one';

/**
2 changes: 1 addition & 1 deletion src/connectionMethods/query.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { executeQuery } from '../routines';
import { executeQuery } from '../routines/executeQuery';
import {
type Field,
type InternalQueryMethod,
2 changes: 1 addition & 1 deletion src/connectionMethods/stream.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryStream } from '../QueryStream';
import { executeQuery } from '../routines';
import { executeQuery } from '../routines/executeQuery';
import { type Interceptor, type InternalStreamFunction } from '../types';
import { type Readable } from 'node:stream';
import * as through from 'through2';
Loading