js-ojus / flow

A tiny open source workflow engine written in Go (golang)
Apache License 2.0
372 stars 58 forks source link

Do you have plans to provide a version that supports sqlite databases? #114

Open 3xxx opened 5 years ago

3xxx commented 5 years ago

Do you have plans to provide a version that supports sqlite databases? I tried to change your code to support sqlite. The original SQL language is a bit different for mysql and sqlite. If you are considering using a golang orm library like xorm, the flow may have extensive database support.

js-ojus commented 5 years ago

@3xxx

Following your question, I have investigated xorm, gorm, sqlboiler and a few others. I am not in favour of using an ORM. I think that they are too heavy for a tiny library such as flow.

Nonetheless, can you please give me a few examples of the changes that you had to make to the SQL statements, to make them work with SQLite? That may give me some hints. Thanks!

3xxx commented 5 years ago

snap2 snap3

js-ojus commented 5 years ago

Thank you @3xxx !

I have never used SQLite myself. Reading through its documentation, I have realised that SQLite is severely limited in the datatypes it supports. In fact, it is dynamically typed, with actual type determined based on a column type "affinity"!

I can understand the effort that you must be putting into making all DDL and DML statements work with SQLite.

I shall keep this issue open, so that I can give this another thought -- at a more relaxed time!

js-ojus commented 5 years ago

@3xxx

Would it be very difficult for you to use MySQL itself? I ask this since I do not know your deployment constraints.

3xxx commented 5 years ago

Thank you for your answer. There is actually no difficulty in using MySQL. I use SQLite primarily for convenience, because it is embedded and does not require a separate database service to run, so using SQLite makes the developed application easy to deploy. One of the great advantages of the Golang is its ease of deployment.This is not an urgent need. I can work it out.

js-ojus commented 5 years ago

Noted, @3xxx !

As I said, I shall leave this issue open.