Am 12.07.2012 15:48, schrieb Ed Leafe:
> On Jul 12, 2012, at 6:51 AM, Sibylle Koczian wrote:
>
>> I want to change the database backend for an existing (test) application
>> from SQLite to PostgreSQL. The table structures are identical, so I
>> thought I just had to do three things:
>>
>> - create the application using "app = dabo.dApp("myCryptoKey")
>> - put a .cnxml file in the db directory of the application which is
>> right for the PostgreSQL database (and which works in another application)
>
> Database servers such as PostgreSQL have very different connection
> parameters than file-based backends. Did you edit the .cnxml file first?
>
I didn't edit it. I took a .cnxml file from another project, made for
PostgreSQL and for the right database, and copied it into the db
directory of the new project. So there are two .cnxml files there; they
use different connection names.
>> File "./CxnEditor.py", line 543, in writeChanges
>> vals = self.relPaths(self.connDict.values())
>> File "./CxnEditor.py", line 556, in relPaths
>> if self.isFileBasedBackend(val["dbtype"]):
>> KeyError: 'dbtype'
>>
>> What is happening here? What sort of information should I provide?
>
> First off, what was the setting for the "Database Type" dropdown? That
> should be what is in val("dbtype").
In the dropdown it's "PostgreSQL".
>
> Second, it sounds like it is connecting to your SQLite database, not
> the PostgreSQL database, since you said that the password was empty (unless
> neither require a password to connect).
>
The PostgreSQL database does require a password. But if I open a .cnxml
file in th CxnEditor, the test button should use the connection in this
file, shouldn't it?
> Third, I would generally define two connections, one for each backend,
> and then use some sort of configuration setting to determine which connection
> to use when you run your app. That is generally how I have handled moving
> between development and production backends.
>
I have defined two connections, I just hard-coded first one and then the
other in the application. Shouldn't that work as well?
Another thing: after trying to save the file, getting the exception and
closing the CxnEditor, the file is empty.
Greetings,
Sibylle
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]