-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Add support for other db clients #762
base: v3
Are you sure you want to change the base?
Conversation
@poeti8 It seems like the migrations got messed up somewhere in the past. Some migrations are modified at a later stage or appied multiple times. I'd adress this in another PR to not blow this one up. |
@marvin-wtt Hmmm I see. Thanks. |
# Conflicts: # server/utils/utils.js
@poeti8 PR should be ready for review now |
@poeti8 I think it would be best to add some tests to verify that it actually works for different DB types, mainly mysql, mariadb, pg, and sqlite3. I offer to do it. Does vitest work for you, or do you prefer jest? |
Thank you, I'll run this to test it soon.
vitest please. |
I think it's easier if you just check out the migrations PR directly. This way you can just run |
Hey, any updates on this? Is it done other than my suggestions? |
Sweet, thanks. Yes, we can leave the tests for another pull request. I'll go ahead by testing and merging this one soon.
I'll take a close look again. We'll figure something out. |
…d to get its length
Returning is not supported by mysql. By default the inserted id is returned. For pg, returning id should result in the same |
Yes I noticed. The mistake however was that knex doesn't return |
I think your fix breaks MYSQL support. Can you confirm? Maybe we need to add a helper function. return typeof res[0] === 'string' ? res[0] : res[0].id; |
You're right I should make sure. I'll write a helper function if that is the case. Although, I assume knex would be consistent with what it returns, otherwise people would end up handling all sort of edge cases manually. |
This looks good. I'll test everything manually again with the three databases and merge it after. Really good job. Thanks! |
Found an issue: Dates in SQLite are saved like |
I'll take a look. If it's not possible to store it in zulu time, at least we can add a knex typecast so no helper function is needed |
About
Add support for other DB client drivers.
See ##761
Breaking Change
Tasks
returning
in queries