Git Product home page Git Product logo

elcy's People

Contributors

dependabot[bot] avatar leoc11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elcy's Issues

Support assignment operator in select statement.

Useful for accumulative sum. example:

let total = 0;
const accumulateResult = await db.table1Set.setParameters({ total }).select(o => ({
 column1: o.column1,
 accumulativeSum: total += o.column1
})).toArray();

Note: total variable will not be affected.

Need benchmark

  • Expression builder.
  • Query generation speed (with/out cached).
  • Result parse speed.

Refactor IIncludeRelation

IIncludeRelation should support RelationData.

note: Include via join that result in many-many relation should be consider too

JSON column support

  • New column decorator
  • Querybuilder: auto translate JSON member access to correct sql syntax

Embedded column

Though some embedded column code has been merged to master. but it still not working yet.
This issue only intended to track pending task.

ternary operator issue

currently the following code does not work.

  1. If true result and false result has different value type, prop1 value will always has true result type. in blow case, prop1 will always be a string.
await db.table1Set.select(o => ({
 prop1: o.condition ? o.string : o.number
})).toArray();
  1. Relation is not yet supported in ternary operator. run code below will result in runtime error.
await db.table1Set.select(o => ({
 prop1: o.anycondition ? o.column : o.relation
})).toArray();

More test

  • Schema builder.
  • Update.
  • Insert.
  • Delete.
  • Batch update.
  • Batch delete.
  • Querybuilder. (with all supported expression)
  • Save changes.
  • Changes detection.
  • Relation Changes detection
  • Add/Remove relation.
  • Sqlite test.

Inheritance

Support 3 types of inheritance.

  • Table per Concrete class.
  • Table per Class.
  • Single Table.

Usage Example

Single Table

@Entity()
abstract class ClassA { }

@AbstractEntity()
class ClassA1 extends ClassA{}

Table per Concrete Class

@AbstractEntity()
abstract class ClassA { }

@Entity()
class ClassA1 extends ClassA{}

Table per Class

@Entity()
abstract class ClassA { }

@Entity()
class ClassA1 extends ClassA{}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.