Nicholas,
This is just what I need!
Few questions:
1) What for need value of db_shard_id? Only for internal usage in
mysql/postgres/... or I should use it explicitly?
2) Can I use "cross-db" models? Something like this:
SiteUser: Id, Name -> db1
ForumUser: Id, SiteUserId -> db2
Is valid call:
user = forum_user:site_user()
среда, 19 марта 2014 г., 21:37:17 UTC+4 пользователь Nicholas Whittier
написал:
> Use db_shards in boss config.
>
> ....
>
> {db_shards, [
> [{db_host, "localhost"},
> {db_adapter, pgsql},
> {db_port, 5432},
> {db_username, "pg_user"},
> {db_password, "pg_pass"},
> {db_database, "pg_db"},
> {db_shard_id, shard_pg},
> {db_shard_models, [some_postgres_model,another_postgres_model]}],
> [{db_host, "mysql.example.com"},
>
> {db_adapter, mysql},
> {db_port, 3306},
> {db_username, "my_user"},
> {db_password, "my_pass"},
> {db_database, "my_db"},
> {db_shard_id, shard_my},
> {db_shard_models, [some_mysql_model,another_mysql_model]}]
>
> ...
>
>
> Note that you can still use the default db setting (mock, via mnesia) to
> handle sessions and boss-specific db needs.
>
> -- Nicholas
>
>
> On Tuesday, March 18, 2014 8:30:53 PM UTC-7, jiale.chan wrote:
>>
>> Hi,
>>
>> I have tow mysql db,
>>
>> How to connect two or more database by boss_db?
>>
>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/ebfb94d4-9595-45bf-997d-16ddc3cc57e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.