GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
It seems the propel inser-sql nor sql:insert inserting the sql to the database
Is it a bug, or am I missing to add something.
no errors nothing is shown.
So I started to look what may be wrong.
I am doing
vendor/bin/propel migration:status --connection bookstore=mysql:host=127.0.0.1;dbname=mydb;user=root
Checking Database Versions...
SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected
In the AbstractCommand I did an echo
What I noticed is the extra parameters dbname etc are getting missed
The vardump of connection in MigrationStatusCommand is
I have build.properties
# Database driver
propel.database = mysql
# Project name
propel.project = bookstore
propel.database.url = mysql:host=localhost;dbname=test
propel.database.user = root
propel.database.password = password
propel.project.dir = /media/Linux/aurasystem
# The directory where Propel expects to find the XML configuration files.
propel.conf.dir = /media/Linux/aurasystem
propel.runtime.conf.file = runtime-conf.xml
propel.buildtime.conf.file = buildtime-conf.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Uncomment this if you have PEAR Log installed
<adapter>mysql</adapter> <!-- sqlite, mysql, mssql, oracle, or pgsql -->
weird issue, it should not fail that way.
I have the exact same issue with a PostgreSQL application. The generated SQL code seems fine and there is no error when I run propel sql:insert but the tables aren't created :
$ psql foo
Type "help" for help.
No relations found.
Are there any improvements or updates on the issue? I'm having the same issue - sql:insert does nothing .. no errors, no tables.
@harikt The semicolons are breaking up your connection string (semicolons in shell are considered returns); if you escape them it should get passed correctly.
propel insert-sql --connection bookstore=mysql:host=127.0.0.1\;dbname=mydb\;user=root
I've submitted a pull request that fixes the underlying issue with insert-sql failing, however.
Thank you for the information @evansims . And great for the 👍 PR
@robin850 the hint with the escaped semicolon when used from CLI should be noted somewhere in the docs, I guess?
In the UNIX doc I'd say, ; separates commands in a shell.
edit: nevermind, misread last comment. sure the doc should be updated accordingly
The probably better way'd be just to surround the connection string with single quotes, also good to pass passwords that contain $ chars.
$ propel insert-sql --connection 'bookstore=mysql:host=127.0.0.1;dbname=mydb;user=root'
@marcj good point... we should just note in the docs which notation is prefered