-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Conversation
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'; |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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!
drizzle-orm/src/neon-http/session.ts
Outdated
@@ -1,76 +1,97 @@ | |||
import type { FullQueryResults, QueryRows } from '@neondatabase/serverless'; | |||
import type { BatchItem } from '~/batch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here’s the other.
There was a problem hiding this comment.
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:
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.
There was a problem hiding this comment.
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!
No description provided.