521 [TRACE] Executing: CREATE TABLE to_do (text TEXT, done INTEGER, id INTEGER PRIMARY KEY AUTOINCREMENT)
523 [TRACE] Executing: DROP INDEX IF EXISTS to_do_index
523 [INFO] DDL constructed successfully.
579 [TRACE] Executing: INSERT INTO to_do (text, done) VALUES ('dishes', false)
Exception in thread "main" 580 [ERROR] Query execution error: SQLite error:com.almworks.sqlite4java.SQLiteException: [1] DB[1] exec() no such column: false
org.orman.dbms.exception.QueryExecutionException: Query execution error: SQLite error:com.almworks.sqlite4java.SQLiteException: [1] DB[1] exec() no such column: false
at org.orman.dbms.sqlite.QueryExecutionContainerImpl.throwError(QueryExecutionContainerImpl.java:38)
at org.orman.dbms.sqlite.QueryExecutionContainerImpl.executeOnly(QueryExecutionContainerImpl.java:114)
at org.orman.mapper.Model.insert(Model.java:86)
at demo10todo.Main.main(Main.java:23)
Because SQLite does not have boolean but can store 0 and 1 in int field and we are serializing boolean variables using Boolean.toString() method in org.orman.sql.util.Serializer.java.
We should investigate that using 0 instead of false and 1 instead of true will work in MySQL and also compatible with generic SQL implementations.
Example scenario below
Logs:
Because SQLite does not have
boolean
but can store0
and1
inint
field and we are serializing boolean variables usingBoolean.toString()
method inorg.orman.sql.util.Serializer.java
.We should investigate that using
0
instead offalse
and1
instead oftrue
will work in MySQL and also compatible with generic SQL implementations.