Skip to content

For an sqlite table with a primary key that is AUTOINCREMENTED sqlautocode will fail (sqlite_sequence issue) #30

@GoogleCodeExporter

Description

@GoogleCodeExporter
 In sqlite, when you create an autoincremented key, a sqlite_sequence table is created automatically. The problem is that this table has no primary key making sqlalchmey and sqlautocode fail with "sqlalchemy.exc.ArgumentError: Mapper Mapper|Temporal|sqlite_sequence could not assemble any primary key columns for mapped table 'sqlite_sequence'".

 The bigger problem is, however, that when you're trying to generate a declarative model (using the -d flag), the table filtering option is not working - or more accurately is not even handled.

Simple schema:
CREATE TABLE builds (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            repository TEXT,
            revision TEXT,
        );

And try:
sqlautocode -d -t builds sqlite:///builds.db

I've attached a superficial fix for whoever needs it (python 2.6)

Original issue reported on code.google.com by catalin....@gmail.com on 26 Dec 2010 at 8:52

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions