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

Missing quotes in some requests ? #518

Open
pvdbk opened this issue Nov 29, 2023 · 0 comments
Open

Missing quotes in some requests ? #518

pvdbk opened this issue Nov 29, 2023 · 0 comments

Comments

@pvdbk
Copy link

pvdbk commented Nov 29, 2023

Used YesSql version : 3.5.0

We create tenants on Orchard, using Postgres and various table prefixes, like "1abcd". When one of these prefixes begin with a numeric characters, we get an error. Here is a part of the stack trace.

  at YesSql.Sql.SchemaBuilder.Execute(IEnumerable1 statements) in YesSql.Sql\SchemaBuilder.cs:line 50
  at YesSql.Sql.SchemaBuilder.CreateForeignKey(String name, String srcTable, String[] srcColumns, String destTable, String[] destColumns) in YesSql.Sql\SchemaBuilder.cs:line 245
  at YesSql.Sql.SchemaBuilder.CreateMapIndexTable(Type indexType, Action1 table, String collection) in YesSql.Sql\SchemaBuilder.cs:line 74

More generally, in SchemaBuilder, it seems that you can not call CreateMapIndexTable when TablePrefix begins with a digit.

Perhaps, this issue could be solved adding quotes to the Name property of the various ISchemaCommand treated in YesSql.Sql.BaseCommandInterpreter.Create.

However, it would fix the SQL request generated in our case. Here is an exemple of a generated request with the lake of quotes :
alter table "1abcd_UserIndex" add constraint 1abcd_FK_UserIndex foreign key "DocumentId" references "1abcd_Document" ("Id")

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

1 participant