Releases: Entity-Access/entity-access
v1.0.411
Full Changelog: v1.0.408...v1.0.411
Simple Join
You can join two tables only as a where clause. Selecting combined mapping will be released in future.
The following example shows how to join two tables with no relations and with on clause for like method.
const fp = db.filePermissions.where({ userID} , (p) => (x) => x.useID === p.userID);
q = db.files.innerJoin(fp, (fq) => (x) => Sql.text.startsWith(x.path, fq.path));
Union All
You can union multiple queries a single query for improved performance instead of using OR clause.
const ownedFiles = db.files.where({userID}, (p) => (x) => x.ownerID === p.userID);
const sharedFiles = db.files.where({userID}, (p) => (x) => x.fileShares.some((fs) => fs.ownerID === p.userID));
const allFiles = sharedFiles.unionAll(ownedFiles);
v1.0.408
Full Changelog: v1.0.403...v1.0.408
Added RANK
, DENSE_RANK
, ROW_NUMBER
window functions.
(p) => (x) => Sql.window.denseRank.orderBy(x.marks)
=> DENSE_RANK() OVER (ORDER BY marks)
(p) => (x) => Sql.window.denseRank.partitionByOrderBy(x.class, x.marks)
=> DENSE_RANK() OVER (PARTITION BY class ORDER BY marks)
v1.0.403
Full Changelog: v1.0.376...v1.0.403
- Added
isJson
in Sql Functions. - Added
updateSelect
to perform select after updating values. - Added High performance Json Serialization, which serializes json asynchronously.
- Json Serialization is non recursive function which reduces pressure on stack.
- Added
preJson
event that is executed before json serilalization
v1.0.376
Full Changelog: v1.0.365...v1.0.376
- Added register disposable in DI Scope
- ForeignKeyConstraint added for
RelateOne
- Multiple transactions in single scope fixed
- Added error message parameter for
firstOrFail
v1.0.365
Full Changelog: v1.0.364...v1.0.365
- QueryExpander's parentType fixed.
v1.0.364
Full Changelog: v1.0.346...v1.0.364
- Made
null not distinct
on Postgres as default. - Index creation issue fixed on Postgres.
- Null check made explicit in direct statements.
- Added unit test for insertInto.
- Added ThrottleGroup for workflows.
- Duplicate ChangeSet detection fixed.
- Added DateTime as Default type for Postgres and Sql Server drivers.
v1.0.346
v1.0.320
Full Changelog: v1.0.301...v1.0.320
- Added sum of items, see below.
- Projection with filter fixed.
- Sql transformer rewritten to improve speed.
- Added transaction save points.
- likeAny query improved for Postgres.
- Added text length function like
Sql.text.length(.)
- Added
updateSelect
- Improved SaveChanges with directly generated queries instead of query expressions
Sql.coll.sum( (x) => x.products
.map((p) => ({
total: 1,
paid: p.orders
.filter((o) => o.status === "paid")
.some((o) => true) ? 1 : 0
}) )
This way you can get count of all orders and paid ones in a single call.
v1.0.301
Full Changelog: v1.0.290...v1.0.301
- Added trace in save options, you can view every query executed in save changes.
- Constraint name check fixed for postgres.
- Added FK constraint name.
- Include relation fixed.