Ticket #493 (closed Feature Request: fixed)
ORM Does Not Allow For Multiple DB'S
| Reported by: | glock_coma | Owned by: | Shadowhand |
|---|---|---|---|
| Priority: | major | Milestone: | 2.2 |
| Component: | Libraries:ORM | Version: | SVN HEAD |
| Keywords: | Cc: |
Description
Currently, Kohana's ORM does not allow for the use of other db's besides the default db.
[20:29] <NS|Glock_Coma> how do you set the db which a ORM Model uses? [20:35] <allain> It gets it's db from Kohana::$instance->db [20:35] <NS|Glock_Coma> what if i need to use a different db? [20:36] <allain> Since it's a static field [20:36] <allain> ... [20:36] <allain> I think you're out of luck. [20:36] <allain> All of them use the same one. [20:36] <allain> All ORM objects have to use the same DB [20:36] <allain> Submit a ticket. I think it's worth it. [20:37] <PugFish?> you can override connect() in your model and create your own db connection [20:37] <allain> Bug isn't self::$db used for all of the instances [20:38] <PugFish?> yea [20:39] <allain> So you'd be doing it for all instance of the subclass in one shot. [20:39] <PugFish?> well i'd assume you'd want to, but yea that's a limitation
