-
Notifications
You must be signed in to change notification settings - Fork 1
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
createTableIfMissing
option not working
#1
Comments
Hi @Chaphasilor, thanks for trying this out 👍 For the However, it is possible there's an issue with the table and schema name not properly escaped. I tested the |
Hmm, I'm using the default table name, so that's not it. My debug logging showed that the error was thrown in the |
That's strange because during my tests, table creation errors were thrown and displayed even without debug enabled. Does the
The problem is where and how to report the error if it fails? A database call when creating the store instance would require top-level-await |
Edit: However, if I delete the table while the server is running, it doesn't check if the table exists anymore, so Checking if the table exists is probably a bit too much overhead do to with each db access, so I think the behavior is fine. Maybe you could try to confirm this behavior and include a notice in the readme before closing the issue 😉 |
You're right, sorry, I forgot Would you like a dedicated method for creating the table programmatically? |
never used that, I'm switching over from MySQL :) I'm still trying to figure out where exactly the error is originating, if I find out anything new I'll let you know.
Don't think that's necessary. If anything it should be created automatically :) |
I had a look at the passport.js documentation and it seems it don't use the store directly but the
Maybe I could help you more with some logs/code sample, if you can share them?
The problem is where to report any creation error. I could start the table creation asynchronously, but it may cause an unhandled promise rejection and crash the process on recent Node versions 😕 That's why I think a dedicated method is the way to go, as it let the user decide whether or not and how to deal with rejections. |
But would the method replace the I can send you some more logs tomorrow :) |
Hey there,
just got around to trying this out, took a bit longer than anticipated ^^
Anyway, I struggled quite a bit at first because I trusted in the
createTableIfMissing
option to create the table, but it never did that.This resulted in errors, which weren't really shown (probably because
express-session
only shows them in debug mode, which is odd). I had to manually add debug logging to access the error.Maybe you could add some warnings if the table doesn't exists, etc.? (And fix the option, naturally 😉)
The text was updated successfully, but these errors were encountered: