apstanisic / zmaj

Zmaj is a headless CMS for managing database
https://zmaj.vercel.app
MIT License
5 stars 0 forks source link

Enable mysql and sqlite #34

Open apstanisic opened 1 year ago

apstanisic commented 1 year ago

SQLite would make it easier to start new project without docker. There is good enough coverage that most of the things should work. I think only getting composite unique key is pg specific, and that can be easily ported.

apstanisic commented 1 year ago

SQLite complicates by treating dates as normal text. So there are 5 different types. Knex uses integer, (maybe it's temporary bug), sequelize uses custom format, CURRENT_TIMESTEMP returns without ms, it's a mess

apstanisic commented 1 year ago

Maybe simplest solution is to check value when reading. This is done in sequelize, that I have to fix, since I think it does not support CURRENT_TIMESTAMP. Instead of new date, I can use knex.fn.now, maybe?

apstanisic commented 1 year ago

If I want sqlite support, I certainly have to remove knex, since it's causing a lot of problems having 2 connections. And some weird behavior with transactions, it says it's busy. No problem in pg

apstanisic commented 1 year ago

It also means converting migrations from JSONB to JSON