Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

SQLite Comaptibility #71

Closed
DaAwesomeP opened this issue Jun 13, 2014 · 3 comments
Closed

SQLite Comaptibility #71

DaAwesomeP opened this issue Jun 13, 2014 · 3 comments

Comments

@DaAwesomeP
Copy link
Contributor

There don't seem to be too many differences between the SQL commands for MySQL and SQLite. I'm not sure how a conduct a proper test, but I am about to try some of the functions that I need.

I think that if it works, Squel should be marked to have official support for it. Of course, a full test should be done before that.

@hiddentao
Copy link
Owner

Squel purports to support standard SQL queries that everyone uses, though I don't claim Squel's support to be comprehensive by any means. People can add support for whatever querying they desire - if it falls outside the standard then it can be added to a 'flavour' of Squel, similar to how Squel already has PostgreSQL and MySQL flavours. I used a SQLite a while back and I remember there were a few things (like PRAGMA queries) that are specific to it so perhaps it would be better to introduce an sqlite flavour. I'm happy for this to happen as and when people need it but I don't deem it necessary to investigate it fully right now.

@donpdonp
Copy link

i just hit a sqlite issue - insert().setFields({boolfield: true}) => INSERT ... (boolfield) values (TRUE).

sqlite says no such column: TRUE. it'd be nice if squel would translate true/false to 1/0 when the flavor is set to sqlite.

@donpdonp
Copy link

as soon as I posted this, I found squel is already good at doing custom data type handling. thanks!

squel.registerValueHandler('boolean', sqlite_bool)

function sqlite_bool(tf) {
  return tf ? "1" : "0"
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants