Welcome Guest, Not a member yet? Register   Sign In
possible to rename db-table in active record ?
#7

[eluser]CroNiX[/eluser]
Not everything needs to go in Active Record (It can't handle EVERY situation, obviously). I have lots of complex queries that I just execute using db::query(). You just have to be sure to manually escape input, like you would anywhere else. I'd rather spend time quickly writing real queries than try to figure out how to make them work just for Active Record. I'd say I use AR about 90% of the time for the quick, easy stuff that doesn't take fudging around.

Active Record really is also for portability. So you can run the same (AR) queries on MSSQL as you do MySQL or Oracle, even though SQL varies quite a bit between each one. Yes, its possible your application might need to run on a different platform, but in 20+ years of coding, I've yet to have that happen. 99.9999% I usually know up front which db is needed, and the application won't be moved to something else.

@Jan The terminology is "table alias", not "rename a database table". They are really different things. One is temporary and only exists in memory, the other is a permanent change to the table structure.


Messages In This Thread
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:09 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:14 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 07:16 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 08:27 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 08:33 AM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 12:42 PM
possible to rename db-table in active record ? - by El Forum - 02-01-2012, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB