-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unrecognized configuration parameter "tables" #164
Comments
The issue here is that we run |
hmm i see, Postgrespostgres equivalent for
the problem with both commands are, that they are also listing internal table schemas( pg_catalog and infromation_schema). so you can hardcode a little bit like this:
but then you force the user to use the public schema. how is the support of postgres schemas in propel? if there is any schema support we maybe can use it for this. infos partly from http://stackoverflow.com/questions/769683/show-tables-in-postgresql what also would be possible is to make something like this:
all the system tables are owned by the postgres user, so sleecting by
Sqlitefor sqlite the command is (tested with sqlitemanager in firefox on windows) general command: http://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file Conclusioso if we want to fix this we have to refactor the following section https://github.com/propelorm/PropelBundle/blob/1.1/Command/TableDropCommand.php#L85 for me this is not a PropelBundle bug, but a Propel bug, because Propel, as good DBAL, should handle this. if i use propel i just want to call |
Well. Does a DBAL need database introspection at runtime? I'm not sure. It's better if you focus on performance ;) |
my answer would be yes. if i need performance i still can call plain sql. but if i simply want it to work, i would need it |
This feature was more an "extra" command than a really required feature. I don't plan to work on that at the moment, but we really need to find a better solution. |
what do you think of having such a feature? i think it's not that difficult to research it for all databases. propel2 maybe? where should the $xxx->getTableNames() be added? to the connection? $con->getTableNames()? if you tell me where to add, i can have a look at it and try forging a PR |
Let me think about that :) Oh, and please open an issue in the Propel2 tracker as a Feature Request. |
for reference, here is the query used by Doctrine DBAL for Postgres: https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L193 |
We have already a parser since years that support this, although especially Postgres and SQLite is only with v2 really stable. I've no idea why MySQL is still in v2 https://github.com/propelorm/PropelBundle/blob/2.0/Command/TableDropCommand.php hardcoded down to v1. We have for all supported vendors a reverser schema parser: $database = new Database();
$parser = new MysqlSchemaParser();
$parser = new SqliteSchemaParser();
$parser = new PgsqlSchemaParser();
$parser->setConnection($conn);
$parse->parse($database);
$tables = $database->getTables(); |
php app/console propel:table:drop --force
leads to
only found http://stackoverflow.com/questions/7367077/symfony2-how-to-make-a-pgsql-database-reverse-enginering-process-with-propelbun
config error or propel bug?
db tested: postgres, sqlite
The text was updated successfully, but these errors were encountered: