Skip to content

Clone() method in Query class doesn't Clone deeply enough. #747

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

Open
cemahseri opened this issue Apr 25, 2025 · 0 comments · May be fixed by #748
Open

Clone() method in Query class doesn't Clone deeply enough. #747

cemahseri opened this issue Apr 25, 2025 · 0 comments · May be fixed by #748

Comments

@cemahseri
Copy link

var db = new QueryFactory();
var compiler = new PostgresCompiler();

var query = db.Query()
    .Select("id")
    .From("table")
    .Include("public", db.Query(), "foreign_id_1", "local_id_1");

// query.Includes.First().Name => "public"
// query.Includes.Count => 1

var clonedQuery = query.Clone();

clonedQuery.Includes.First().Name = "another_relation";
clonedQuery.Include("public", db.Query(), "foreign_id_2", "local_id_2");

// query.Includes.First().Name => "another_relation"
// query.Includes.Count => 2
@cemahseri cemahseri linked a pull request Apr 25, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant