multiple databases in conf.ini

Archived from the Xataface Users forum.

blange — Mon Apr 19, 2010 9:54 am

Can I include multiple database in the conf.ini file. If so, how do I do this and how to a reference the tables for each database.

Thanks,

-Brian


PolderBoy — Thu Apr 22, 2010 8:12 am

Hello Brian,

I am pretty sure you can’t do this.

PolderBoy


Richard — Tue Apr 24, 2012 12:07 am

Hi,

i have the same problem.

If will make a relationsship between tables in different databases.

in conf.ini it is not possible to let the databasename clear.

In relationship the databasename will be added in the query (why, if the databasename will be forced in conf.ini)
so relationship between different databases is not possible, which is’nt not…

is there a possibility which i have overseen…?

richard


shannah — Sat Apr 28, 2012 9:56 pm

Multiple databases are currently not supported. A workaround is to make MySQL views for any tables that you need to reference in another database. Then just use those views in your application.

E.g.

Database d1 has table t1
Database d2 has table t2

Suppose your application is set up for database d1 but you need to access table d2.t2. Then create a view in d1 called t2 defined as follows:

Code: Select all
create view t2 as select * from d2.t2

That effectively allows you to access table t2 from your application.

Remember to define the primary key for your view though
http://xataface.com/documentation/how-to/views

-Steve