You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe this is from a breaking change, but it seems like it should work so maybe a bug. This is as minimal a repro as I could muster up.
getInstance("A").initTable();
getInstance("B").initTable();
getInstance("C").initTable();
idA = queryExecute("insert into a output inserted.IDa default values").IDa;
idCs = queryExecute("
insert into c (idA, cgroupID, [data]) values (#idA#, 1, 'val1'), (#idA#, 1, 'val2'); -- should be reflect in count
insert into c (idA, cgroupID, [data]) values (#idA#, 2, 'val1'), (#idA#, 2, 'val2') -- should not be reflected in count
")
queryExecute("insert into b (IDa, cgroupID) values (#idA#, 1)", {}, {returnType: "array"})
// quick 7.3.1 : returns 2 (as expected)
// quick 10.0.0 : throws Invalid call of the function [qualifyColumn] , first Argument [column] is of invalid type, Cannot cast Object type [Array] to a value of type [string]
// from modules/quick/models/Relationships/HasManyDeep.cfc:250
writedump(
getInstance("A")
.withCount({"cs as cs": () => {}})
.asQuery()
.firstOrFail().cs
);
// A.cfc
component extends="quick.models.BaseEntity" table="A" accessors=true {
property name="IDa" sqltype="integer";
variables._key = "IDa";
function Bs() {
return hasMany(
relationName = "B",
foreignKey = "IDa",
localKey = "IDa"
);
}
function Cs() {
return hasManyThrough(
relationships = [ "Bs", "Cs" ]
)
}
function initTable() {
queryExecute("
drop table if exists a;
create table a(IDa int not null identity primary key);
");
}
}
// B.cfc
component extends="quick.models.BaseEntity" table="B" accessors=true {
property name="IDa" sqltype="integer";
property name="cgroupID" sqltype="integer";
variables._key = ["IDa", "cgroupID"];
function Cs() {
return hasMany(
relationName = "C",
foreignKey = ["IDa", "cgroupID"],
localKey = ["IDa", "cgroupID"]
);
}
function initTable() {
queryExecute("
drop table if exists b;
create table b(IDa int not null, cgroupID int not null);
");
}
}
// C.cfc
component extends="quick.models.BaseEntity" table="C" accessors=true {
property name="IDa" sqltype="integer";
property name="cgroupID" sqltype="integer";
property name="data" sqltype="varchar";
variables._key = "cgroupID";
function initTable() {
queryExecute("
drop table if exists c;
create table c(IDa int not null, cgroupID int not null, [data] varchar(max));
");
}
}
The text was updated successfully, but these errors were encountered:
Maybe this is from a breaking change, but it seems like it should work so maybe a bug. This is as minimal a repro as I could muster up.
The text was updated successfully, but these errors were encountered: