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

importFile throws when default database was not set #266

Closed
urugator opened this issue Dec 19, 2023 · 1 comment
Closed

importFile throws when default database was not set #266

urugator opened this issue Dec 19, 2023 · 1 comment

Comments

@urugator
Copy link
Contributor

When importFile is being called with database option and default (current) database is not set, it throws

TypeError: Cannot read properties of null (reading 'replace')

return new Promise(tmpQuery.bind(conn, `USE \`${prevDatabase.replace(/`/gi, '``')}\``));

Afaik there is no way to "unuse" database, so it should probably keep using the one passed in options.

rusher added a commit that referenced this issue Dec 20, 2023
@rusher
Copy link
Collaborator

rusher commented Dec 20, 2023

Thanks, reproduced and corrected.
Too late for 3.2.3 that has just been released, but will be on next release.

@rusher rusher closed this as completed Dec 20, 2023
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

No branches or pull requests

2 participants