views:

20

answers:

1

I am running Symfony 1.3.6 on Ubuntu Lucid.

My db connections for Symfony are made with a user with reduced priveleges (no need for CREATE or DROP for example) - for security reasons.

I want to be able to run the propel task propel:sql-insert as root, so that I can create/drop tables at will. The brain dead way to do this would be to modify config/database.yml and use a root name and pwd whenever I need to run this task.

A smarter way would be if I could pass a user to the import-sql task. Anyone knows how to do this?

+1  A: 

I don't have 1.3 here; rather 1.4, but taking a look inside lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task/sfPropelInsertSqlTask.class.php (phew!) yields the following parameter you can pass - presumably the same for 1.3:

You can also use the --connection option if you want to only load SQL statements for a given connection.

Therefore this would imply that you can create a new connection in your config/databases.yml which is specific to the insert-sql task (eg username root, no password), and then pass this connection name along when you run the insert-sql task.

Untested... :-)

richsage
@richsage: That's some fine spelunking there, Rich. Some mighty fine spelunking :)
morpheous
Heh, I do enjoy my spelunking :-)
richsage