SPOD / Sqlite bug

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SPOD / Sqlite bug

Frank Endres
Hi !

First, I tryed to use SPOD with SQlite database and got compile errors (haxe 2.0.8). To fix, I had to remove (not really needed):
  • neko/db/Connection.hx,
  • neko/db/ResultSet.hx,
  • php/db/Connection.hx
  • and php/db/ResultSet.hx
Then, I edited neko/db/Sqlite.hx and php/db/Sqlite.hx and replaced the line: "import php/neko.db.Connexion;" by the following:
  • import sys.db.Connection;
  • import sys.db.ResultSet;
I had to use -D spod_macro compilation flag

Second, the TableCreate doesn't work with Sqlite AutoIncrement (the table is created, but auto increment doesn't work). The correct create syntax is:
CREATE TABLE table_name (id INTEGER PRIMARY KEY AUTOINCREMENT, ...
it must be INTEGER (not INT) followed by PRIMARY KEY AUTOINCREMENT (not AUTO_INCREMENT / unlike MySQL). See http://www.sqlite.org/autoinc.html

SPOD is great, thanks !

Best regards !

Frank Endres, les Sables d'Olonne

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: SPOD / Sqlite bug

Nicolas Cannasse
Le 10/12/2011 14:30, Frank Endres a écrit :

> Hi !
>
> First, I tryed to use SPOD with SQlite database and got compile errors
> (haxe 2.0.8). To fix, I had to remove (not really needed):
>
>   * neko/db/Connection.hx,
>   * neko/db/ResultSet.hx,
>   * php/db/Connection.hx
>   * and php/db/ResultSet.hx
>
> Then, I edited *neko/db/Sqlite.hx* and *php/db/Sqlite.hx* and replaced
> the line: "*import php/neko.db.Connexion;*" by the following:
>
>   * import sys.db.Connection;
>   * import sys.db.ResultSet;
>
> I had to use -D spod_macro compilation flag

Yes, Sqlite was not part of 2.08, but is now available on SVN.

> Second, the TableCreate doesn't work with Sqlite AutoIncrement (the
> table is created, but auto increment doesn't work). The correct create
> syntax is:
> CREATE TABLE table_name *(id INTEGER PRIMARY KEY AUTOINCREMENT*, ...
> it must be *INTEGER* (not INT) followed by *PRIMARY KEY AUTOINCREMENT*
> (not AUTO_INCREMENT / unlike MySQL). See http://www.sqlite.org/autoinc.html

Thanks for the report I've fixed that on SVN, could you update the class
and check again ?

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org