On Sun, 2010-09-12 at 03:11 -0700, Onip wrote:
> $ sqlmetal -namespace:Foo -language:csharp -code:output.cs test.db3 -
> provider:SQLite -dbml:output.dbml

You're missing two things:

 1. You can't use both -code and -dbml at the same time.
 2. As per 'sqlmetal --help', any non-option arguments are DBML files.
    You're passing test.db3 as a DBML file, which won't work.

Assuming you want a DBML file, you need two things: a sqlmetal
invocation with -conn to create the .dbml (to provide a connection
string so that test.db3 will be used), and a second sqlmetal invocation
to create the .cs file:

        sqlmetal -conn "Data Source=test.db3" -provider:Sqlite \
                -dbml:output.dbml
        sqlmetal -code:output.cs output.dbml

Unfortunately, while that works with DbMetal, that fails with sqlmetal
because it's missing an XSD resource. :-/

So what you actually need to do are two "full" invocations:

        sqlmetal -conn "Data Source=test.db3" -provider:Sqlite \
                -dbml:output.dbml
        sqlmetal -conn "Data Source=test.db3" -provider:Sqlite \
                -code:output.cs

ALSO, your .sql file is incorrect: sqlmetal is case-sensitive, yet your
create.sql file has:

        CREATE TABLE owners ...
        CREATE TABLE pets (
            ...
            FOREIGN KEY (owner) REFERENCES Owners (id)
        );

'owners' != 'Owners', so you'll need to fix this as well.

 - Jon


-- 
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en.

Reply via email to