Gajus Kuizinas

Results 763 comments of Gajus Kuizinas
trafficstars

Somehow including `import gql from 'graphql-tag';` is causing `module` to be undefined. I am puzzled.

haven't figured out what is the issue with how `craco-plugin-react-hot-reload` is patching CRA, but simply doing: ```js /* eslint-disable import/no-commonjs, filenames/match-regex, import/unambiguous, global-require */ module.exports = { webpack: { configure:...

@ardsh FYI, this has been ported to Slonik monorepo. If you are comfortable with it, I will port your patch to https://github.com/gajus/slonik/tree/main/packages/slonik-dataloaders

@monken Any reason this was never merged?

* `QueryCancelledError` can be used to capture `pg_cancel_backend`. * `BackendTerminatedError` can be used to capture `pg_terminate_backend`. https://github.com/gajus/slonik/issues/39

Example implementation: ```js const cancellableConnection = async (pool: DatabasePoolType, handler: (connection: DatabaseConnectionType, cancel: () => Promise) => Promise) => { return pool.connect(async (connection0) => { let done = false; const...

A more correct implementation: ```js const cancellableConnection = async (pool: DatabasePoolType, cancellableConnectionRoutine: CancellableConnectionRoutineType) => { let done = false; return pool.connect(async (connection0) => { return pool.connect(async (connection1) => { const...

We could extend this beyond `WHERE`, e.g. ```ts extendQuery(foo, ({name}) => { return sql` WHERE ${name} = 'Foo'` ORDER BY ${name} ASC }); ```

We could even go further by allowing to compose queries using sql tags, e.g. ```ts const foo = sql.type( z.object({ id: z.number(), name: z.string(), }) )` SELECT id, name FROM...

At the moment this is just for food thought.