-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: neon connector #117
base: main
Are you sure you want to change the base?
feat: neon connector #117
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
=======================================
Coverage ? 41.47%
=======================================
Files ? 23
Lines ? 892
Branches ? 91
=======================================
Hits ? 370
Misses ? 516
Partials ? 6 β View full report in Codecov by Sentry. |
return getConnection().then((c) => c(this._sql, params || this._params)); | ||
}, | ||
run(...params) { | ||
return getConnection().then((c) => c(this._sql, params || this._params)); |
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.
run
is supposed to only return success
right? currently we are returning whatever we get back, so I should change that?
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.
Can you confirm what is production behavior of neon currently? Ideally if it returns additional info, it seems to be correct.
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'm so sorry, I've missed your comments π₯² sure that sounds good
examples/neon/index.ts
Outdated
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.
In the examples dir, we don't have connectors which are documented (only integrations) -- this can be reverted and instead improve tests.
import connector from "../../src/connectors/neon"; | ||
import { testConnector } from "./_tests"; | ||
|
||
describe.runIf(process.env.POSTGRESQL_URL)( |
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 wish we could somehow mock @neondatabase/serverless
(not sure if in their SDK they have it already). We could use something like pglite to emulate their interface in order to allow automated tests.
|
||
export default function neonConnector(opts: ConnectorOptions) { | ||
let _connection: NeonQueryFunction<undefined, undefined>; | ||
const getConnection = async () => { |
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.
This seems can be non async right?
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.
true!
π Linked issue
related to #32
β Type of change
π Description
this PR adds support for
neon
connector using@neondatabase/serverless
+ an example ofneon
π Checklist