3.0 Implement connection prefixes #2666

Closed
josephzidell opened this Issue Jan 16, 2014 · 5 comments

Projects

None yet

3 participants

@josephzidell

Table prefixes don't seem to work in 3.0

The db is called "wwc", and the prefix is "wwc_". I have a table called "wwc_tags", and created a TagsTable file in Repository, but get this error message:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wwc.tags' doesn't exist

Also, in http://book.cakephp.org/3.0/en/orm/database-basics.html#configuration there's no mention of prefix in the "full list".

@markstory
Member

Nope, we've not implemented table prefixes yet. Last we talked, prefixes were only going to be at the connection level, and never at the table level as that got out of hand when people combined connection + table prefixes.

@josephzidell

What's involved in getting it to work at the connection level?

@lorenzo
Member
lorenzo commented Jan 16, 2014

It would be quite simple, actually. Just modify the from and join methods in Cake\Database\Query to modify the the name by calling a new method fullTableName in the connection object.

@markstory
Member

@lorenzo Don't forget about joins as well. I should learn to read.

@lorenzo
Member
lorenzo commented Sep 23, 2014

Closing as duplicate of #4118

@lorenzo lorenzo closed this Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment