Welcome Guest, Not a member yet? Register   Sign In
Active Record, DB Forge, and Database Session Data ... Oh My
#1

[eluser]AgentPhoenix[/eluser]
Alright, the basics. I'm building an application that's supposed to be database agnostic, which means that the AR and DB Forge stuff is absolutely invaluable. I'm also going to be storing session data in the database through NGSession. However, today I've been working on taking my schema from paper to the application and I've run into an interesting issue.

When storing session data in the database, you've gotta create a table called ci_sessions. Excellent. Only problem is that my installation is running entirely through DB Forge, meaning that it appends the database prefix to all of the queries. That's no problem at all either, until you get to the config file and setting the table that session data is stored in. It's hard-coded as ci_sessions, but by going through DB Forge, the actual table created is dbprefix_ci_sessions. Since the config file is pulled before the database config file, I have no way of manually setting the prefix for the sessions table in config.php. On top of that, I wouldn't even know where to begin in hand-coding queries for anything besides MySQL. (Not to mention that it'd require some major refactoring of the install process, so I'd like to avoid that if at all possible.)

So, to all the CI experts out there, any ideas about getting around this little problem?


Messages In This Thread
Active Record, DB Forge, and Database Session Data ... Oh My - by El Forum - 07-02-2008, 11:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB