[Dbix-class] sqlite vs mysql

Len Jaffe lenjaffe at jaffesystems.com
Fri Jul 27 04:40:39 GMT 2012


On Fri, Jul 27, 2012 at 12:10 AM, shawn wilson <ag4ve.us at gmail.com> wrote:

> I made this script to operate with mysql. however, I also need it to
> work with sqlite. I am having issues with primary keys with sqlite.
> what am i doing wrong? and can i make this schema work with both db
> types?
>
> the error is:
> err: DBI Exception: DBD::SQLite::st execute failed: org.org_pk may not
> be NULL [for Statement "INSERT INTO org ( agency, symbol, web_ag)
> VALUES ( ?, ?, ? )"] at
> /usr/local/share/perl/5.10.1/DBIx/Class/Schema.pm line 1071.
>
> [SNIP!]


You should probably open your  sqlite db in a db browser (perhaps with
sqlite3) and look at the table definition.  Make sure you created the table
with auto-increment PK.  IT looks like you told Moose about it, but I could
not determine if that's what you told the DB in your CREATE TABLE statement.

Since that's the complaint in the error message, I'm guessing not.

Len.
-- =

lenjaffe at jaffesystems.com   614-404-4214             www.volunteerable.net
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Greenbar <http://www.greenbartraining.org/>: Grubmaster: 2012-2009, Grub
Asst: 2008, Trained: 2007.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120727/e04=
50e7c/attachment-0001.htm


More information about the DBIx-Class mailing list