Replies: 2 comments 2 replies
|
So no any ideas? |
|
Pretty easy to see why a question during the holidays may have been missed! I can't speak for everyone but I know I check out completely from Dec 25th until Jan 1st. I'm not sure why you'd need a new schema for every user but I'm sure you have your reasons. I think it's going to be difficult to achieve what you want to achieve because of the way the scopes are loaded. The Application scope will load before the session scope and really, the specific user information is always found in the session scope. Wheels reads in the tables onApplicationStart and so, even if you had a dynamic DSN for the user set in your session scope, you won't be able to use it in onApplicationStart and you lose the power of the wheels ORM at that point. I've thought about this problem a bit this morning and I don't see an easy way to involve Wheels in this kind of setup. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I want to develop a new web application where each user's data will be stored in a separate database schema.
One database, one Lucee data source, one schema for storing common data and a set of schemas with the same structure.
The new user schema will be created after user registration.
In vanilla CFML the SQL would look like this:
SELECT * FROM user_#session.user.id#.TableOnei.e.
SELECT * FROM user_1.TableOne, SELECT * FROM user_2.TableOne and so on.In CFWheels I can do this:
But this is a bad idea, because objects are stored in Application scope.
How to properly use the database schemas in CFWheels?
Thank you!
All reactions