Project

General

Profile

sqlite create table problem

Added by Mark Petryk almost 5 years ago

When I run with sqlite I cannot create any tables;

create table "zcUserGroup" (
  "sysUser_id" bigint not null,
  "sysGroup_id" bigint,
  primary key ("sysUser_id", "sysGroup_id"),
  constraint "fk_zcUserGroup_key1" foreign key ("sysUser_id") references "sysUser" ("id") on delete cascade deferrable initially deferred,
  constraint "fk_zcUserGroup_key2" foreign key ("sysGroup_id") references "sysGroup" ("id") deferrable initially deferred
)
create index "zcUserGroup_sysUser" on "zcUserGroup" ("sysUser_id")
create index "zcUserGroup_sysGroup" on "zcUserGroup" ("sysGroup_id")
rollback transaction
begin transaction

Right at the end of the table-create process, the process ends with a 'rollback transaction', leaving none of the tables created. There must be an error in the create sequence somehow, but I cannot see what it is.

Is there some way to turn on an error report that might indicate what's going wrong in my table creations? This same schema works just fine on postgres.


Replies (2)

RE: sqlite create table problem - Added by lm at almost 5 years ago

I've noticed that WT tends to be pretty good at logging any errors that happened. If you're not seeing any, maybe run using gdb and, before starting the program, "catch throw"? This will break any time an exception is thrown (whether or not it will be handled).

RE: sqlite create table problem - Added by Mark Petryk almost 5 years ago

I grabbed the createTable() sql and hand-pasted it in to sqlite3 and it accepted it just fine.

I'll try your catch idea.

    (1-2/2)