Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batch API for neon-http driver #1895

Merged
merged 8 commits into from
Feb 22, 2024
Merged

Conversation

dankochetov
Copy link
Contributor

No description provided.

PreparedQueryConfig,
QueryResultHKT,
QueryResultKind,
} from '~/pg-core/session.ts';
import type { PgMaterializedView } from '~/pg-core/view.ts';
import { QueryPromise } from '~/query-promise.ts';
import type { Query, SQL } from '~/sql/sql.ts';
import type { RunnableQuery } from '~/runnable-query';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here’s one of two imports that’s missing a file extension and failing @arethetypeswrong/cli.

To diagnose, I ran attw package.tgz --entrypoints --format json > output.json Unfortunately the JSON data is much more complete than what either the CLI or web UI shows.

    "problems": [
      {
        "kind": "InternalResolutionError",
        "resolutionOption": "node16",
        "fileName": "/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.d.ts",
        "moduleSpecifier": "../../runnable-query",
        "pos": 356,
        "end": 379,
        "resolutionMode": 99,
        "trace": [
          "======== Resolving module '../../runnable-query' from '/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.d.ts'. ========",
          "Explicitly specified module resolution kind: 'Node16'.",
          "Resolving in ESM mode with conditions 'import', 'types', 'node'.",
          "Loading module as file / folder, candidate module location '/node_modules/drizzle-orm/runnable-query', target file types: TypeScript, JavaScript, Declaration, JSON.",
          "Directory '/node_modules/drizzle-orm/runnable-query' does not exist, skipping all lookups in it.",
          "======== Module name '../../runnable-query' was not resolved. ========"
        ]
      }
    ]

FWIW, showing more details and better explanations in the CLI is my top priority for upcoming work on the tool—now that it’s integrated into DefinitelyTyped, it’s been clear it needs to give more guidance. However, it’s still just a side project for me, so progress is slow. Thanks for bearing with me!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fixed the problem, thanks a lot!

@@ -1,76 +1,97 @@
import type { FullQueryResults, QueryRows } from '@neondatabase/serverless';
import type { BatchItem } from '~/batch';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here’s the other.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know if there are reasons this isn’t feasible, but if you want to catch this with a tighter feedback loop, --module nodenext accomplishes that:

image

N.B. ~/session is also missing its extension, but doesn’t show up in attw because PreparedQuery doesn’t appear in the declaration emit for this file (it’s only used inside a function, not as a return/param type), so the import is elided.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fixed the problem, thanks a lot!

@AndriiSherman AndriiSherman merged commit 3952496 into main Feb 22, 2024
8 checks passed
@AndriiSherman AndriiSherman deleted the neon-serverless-batch-main branch February 22, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants