quick icon indicating copy to clipboard operation
quick copied to clipboard

regression in `reset` behavior, 5.2.0->5.2.7

Open davidAtInleague opened this issue 3 years ago • 3 comments

The behavior of reset seems to have changed between 5.2.0 -> 5.2.7.

Grammar is mssql.

Repro:

// entity def
component table="RMME_C" extends="quick.models.BaseEntity" accessors=true {
    property name="ID_C" type="numeric" sqltype="integer";

    variables._key = "ID_C";
}

// table
create table rmme_c (id_c int null);

// do it
v = getInstance("RMME_C")

v.whereID_C(42);

sql = v.reset().retrieveQuery().toSql(showBindings=true);

// v5.2.0 (expected)   --> SELECT [RMME_C].[ID_C] FROM [RMME_C]
// v5.2.7 (unexpected) --> SELECT [RMME_C].[ID_C] FROM [RMME_C] WHERE [RMME_C].[ID_C] = {"value":42,"cfsqltype":"integer","null":false}
writedump(sql);

davidAtInleague avatar Oct 24 '22 14:10 davidAtInleague

Hmmm...this may just be a docs update needed. Does resetQuery() get you what you'd expect?

elpete avatar Apr 26 '23 17:04 elpete

resetQuery does seem to be a substitute for places that were previously using reset -- reset clears at least the select and where lists (and presumably all the other things too but I haven't exhaustively checked).

davidAtInleague avatar Apr 28 '23 13:04 davidAtInleague

I would have expected this behavior to have changed in v5 where we split the entity from the builder.

So did this solve your problem?

elpete avatar Apr 28 '23 15:04 elpete