-
Notifications
You must be signed in to change notification settings - Fork 50
Adds console disclaimer when running direct sql from the browser #158
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
Conversation
|
|
||
| // Ensure we are very explicit while using these apis. This ensures more type safety | ||
| // specially since this library is made to run both in the browser and node.js environments. | ||
| declare global { |
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 was mainly to avoid adding dom types globally to the tsconfig. It makes it more type safe
|
(1) Looks like this applies only to HTTP queries. I guess that's because those are the only ones we support auth for? But it's also possible to connect from a browser via WebSockets. Have we considered warning about that too? (2) We should probably provide a way to suppress this message being printed, so that users can opt out of us cluttering up their console (and maybe making them look a little unprofessional in production). |
(1) I agree we should do WS as well. (2) I wouldn't do this, I think the point is for it to shock people. If someone really pressures us into doing this we can consider it later, shouldn't be hard. |
|
Yeah: I see your point, @davidgomes, but I do think I'd want a way to opt out. Maybe a One other comment: out of an abundance of caution, perhaps we should also test for |
I don't think we should a config option until someone asks for it. I'd rather avoid adding surface area and complexity unless someone specifically complains about it. More configs means more docs, more tests, and more surface area to maintain.
Good idea! |
|
If the warning appears in our SQL editor that's a bit concerning, so I tend to agree that having a way to disable would make sense. This warning doesn't apply to that use case |
|
Ah I see I forgot about that use case. Yeah let’s add a config then!
…On Wed, 23 Apr 2025 at 23:51, Luis Neves ***@***.***> wrote:
*lneves12* left a comment (neondatabase/serverless#158)
<#158 (comment)>
If the warning appears in our SQL editor that's a bit concerning, so I
tend to agree that having a way to disable would make sense. This warning
doesn't apply to that use case
—
Reply to this email directly, view it on GitHub
<#158 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVB5NQ2NSYCSLSBCEWS3323ADPLAVCNFSM6AAAAAB3WAIOG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRVGU3TMMJVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
3a89152 to
2f5490d
Compare
|
Sorry, just two more suggestions:
|
Agreed on both points! |
agreed, good feedback. Already updated it |
fc00001 to
c4e3be4
Compare
| readOnly: neonOptReadOnly, | ||
| deferrable: neonOptDeferrable, | ||
| authToken, | ||
| disableWarningInBrowsers, |
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.
If the option is not specified here, do we inherit from the global configuration parameter? I think we probably should.
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 guess it makes sense. The implementation is a bit weird, because neonConfig in reality is a socket config that we don't use for the http client, but I guess this is good enough (already updated)
jawj
left a comment
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.
LGTM!
Config example for websocket:
I guess for now this should be enough, we can document it later if needed. This way is a good way to get some signal if there are a lot of people disabling it