rdagumampan / yuniql

Free and open source schema versioning and database migration made natively with .NET/6. NEW THIS MAY 2022! v1.3.15 released!
https://yuniql.io
Apache License 2.0
417 stars 63 forks source link

How do I connect to a particular Schema? #278

Open shaileshsolanki16 opened 2 years ago

shaileshsolanki16 commented 2 years ago

Hello Rodel!

I added as string Schema= while setting up the environment variable SETX YUNIQL_CONNECTION_STRING="Host=localhost;Port=5432;Username=;Password=;Database=;Schema="

Below is the error and I think it is due to the addtional string Schema= in the connection string. Please let me know how do i mention the schema name.

ERR 2022-07-04 14:06:18Z Failed to execute run function. Couldn't set schema (Parameter 'schema') Diagnostics stack trace captured a System.ArgumentException: ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at Npgsql.NpgsqlConnectionStringBuilder.GeneratedSetter(String keyword, Object value) at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword, Object value) --- End of inner exception stack trace --- at Npgsql.NpgsqlConnectionStringBuilder.set_Item(String keyword, Object value) at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value) at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString) at Yuniql.PostgreSql.PostgreSqlDataService.GetConnectionInfo() at Yuniql.Core.MigrationService.Run(String workspace, String targetVersion, Nullable1 isAutoCreateDatabase, List1 tokens, Nullable1 isVerifyOnly, String bulkSeparator, String metaSchemaName, String metaTableName, Nullable1 commandTimeout, Nullable1 bulkBatchSize, String appliedByTool, String appliedByToolVersion, String environment, Nullable1 isContinueAfterFailure, String transactionMode, Boolean isRequiredClearedDraft) at Yuniql.Core.MigrationService.Run() at Yuniql.CLI.CommandLineService.RunRunOption(RunOption opts) If you think this is a bug, please report an issue here https://github.com/rdagumampan/yuniql/issues.

Thank you, Shailesh

rdagumampan commented 2 years ago

Hi @shaileshsolanki16 , thanks for reaching out! Im not sure I follow your use case but you its about setting up one database with multiple schema, please explore this option in local or test database and let me know.

https://github.com/rdagumampan/yuniql/releases/tag/v1.2.25