Skip to content
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

evolve and Postgres get error "SHOW VARIABLES LIKE '" #307

Open
ohadab29 opened this issue Jul 11, 2023 · 4 comments
Open

evolve and Postgres get error "SHOW VARIABLES LIKE '" #307

ohadab29 opened this issue Jul 11, 2023 · 4 comments

Comments

@ohadab29
Copy link

Hi all ,

using Postgres DB and Evolve i saw i cam e cross with this ERROR :
2023-07-11 05:45:08.393 UTC [103] ERROR: syntax error at or near "LIKE" at character 16
vulnerability-notifier-database-1 | 2023-07-11 05:45:08.393 UTC [103] STATEMENT: SHOW VARIABLES LIKE '%version%'

at the end i understand Evolve libraary is trying to run query on the DB but syntax is not Postgress....

do you have a solution for that not putting too much noise to the logs?

similar old case i saw : 👍 #70

Thanks
Ohad

@lecaillon
Copy link
Owner

Yes you can. It is not an issue. Evolve try to determinate the type of db you use at start. If you do not want that message, pass the information in the constructor :

var evolve = new Evolve(cnn, msg => Output.WriteLine(msg), DBMS.PostgreSQL)
{
    Schemas = new[] { "public", "unittest" },
    MetadataTableSchema = "unittest",
    Placeholders = new Dictionary<string, string> { ["${schema1}"] = "unittest" }
};

@ohadab29
Copy link
Author

will try it - thank u !!!

@ohadab29
Copy link
Author

today i use :
{
var evolve = new Evolve.Evolve((DbConnection) connection)
{
EmbeddedResourceAssemblies = new[] {GetType().Assembly},
SqlMigrationPrefix = "v",
MetadataTableSchema = "pprepository"

            };

what in the syntax u mentioned will remove the log of error ?

@lecaillon
Copy link
Owner

DBMS.PostgreSQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants