Giter Site home page Giter Site logo

twinlogix / typetta Goto Github PK

View Code? Open in Web Editor NEW
101.0 3.0 4.0 11.39 MB

Node.js ORM written in TypeScript for type lovers.

Home Page: https://twinlogix.github.io/typetta/

License: Apache License 2.0

TypeScript 99.89% Shell 0.01% JavaScript 0.10%
nodejs javascript typescript orm graphql mongodb mysql sqlserver sqllite3 sql

typetta's Issues

Add validation system for single field of and entity

Add validate directives`:

type User @mongoEntity {
  email: String! @validate(logic: "email")
}

The validation logic 'email' is implemented in the specific DAOContext.

Add some ready to use validation logics and it's specific directive. Example:

type User @mongoEntity {
  email: String! @email
  views: Int! @positive
}

Transactions: evaluate the possibility to add a transaction function.

Sometimes a transaction function that wraps all the operations can be easy to use than passing a transaction reference to all the operations. Both options have pros and cons.

Following an example:

const trx = await knexInstance.transaction({ isolationLevel: 'snapshot' })
try {
     await dao.transaction(trx, () => {
         const user = await dao.user.findOne({ 
              filter: { id: '1fc70958-b791-4855-bbb3-d7b02b22b39e' },
              projection: { id: true, balance: true }
          )
          await dao.user.updateOne({ 
              filter: { id: user.id },
              changes: { balance: user.balance + 10 }
          });
      );
      await trx.commit()
} catch(e) {
     await trx.rollback()
}

Mocking functionality

Adding the ability to have a mocked DAOContext where no driver is specified and, by default, the only data source is sqlite in memory database (the user doesn't need to create and pass it to init).

This inmemory database is created if the user pass an explicit mock: true parameter to the DAOContext.

Improve the security policies middleware.

A good idea could be to change the way a user can define a security policy, in a more declarative and expressive way (we can take something from GaphQL Shield?!).

Improvements to scalar adapters typing.

  1. Every scalar adapter should be optional, even for custom scalars. The default should be an identityAdapter.
  2. When a user define a scalar adapter he should have the ability set only a part of the adapter and other methods fallback to identityAdapter.
  3. Exactly as datasources, scalar adapters should have mongo/sql params only if the the DAOContext has mongo/sql data sources. When there's no entity with a driver the DAOContext should not receive configurations for that driver.
  4. If the ID scalar is configured to be generated by the user, its scalar adapter should be required and the generate method should be also required.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency jekyll-feed to v0.17.0
  • chore(deps): update dependency mongodb to v5.9.2
  • chore(deps): update dependency mongodb-memory-server to v8.16.0
  • chore(deps): update dependency prettier to v3.2.5
  • chore(deps): update dependency typedoc to v0.25.13
  • chore(deps): update dependency tzinfo-data to v1.2024.1
  • fix(deps): update dependency yaml to v2.4.2
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency github-pages to v231
  • chore(deps): update dependency knex to v3
  • chore(deps): update dependency mongodb to v6
  • chore(deps): update dependency mongodb-memory-server to v9
  • chore(deps): update dependency release-it to v17
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency typescript to v5
  • chore(deps): update github/codeql-action action to v3
  • chore(deps): update jest monorepo to v29 (major) (@types/jest, jest, ts-jest)
  • chore(deps): update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency chalk to v5
  • fix(deps): update dependency commander to v12
  • fix(deps): update dependency dedent to v1
  • fix(deps): update dependency inquirer to v9 (inquirer, @types/inquirer)
  • fix(deps): update dependency object-hash to v3 (object-hash, @types/object-hash)
  • fix(deps): update dependency type-fest to v4
  • fix(deps): update dependency uuid to v9 (uuid, @types/uuid)
  • fix(deps): update graphqlcodegenerator monorepo (major) (@graphql-codegen/add, @graphql-codegen/cli, @graphql-codegen/plugin-helpers, @graphql-codegen/schema-ast, @graphql-codegen/typescript, @graphql-codegen/typescript-resolvers, @graphql-codegen/visitor-plugin-common)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

bundler
docs/Gemfile
  • github-pages ">= 228"
  • jekyll-feed "~> 0.6"
  • tzinfo "~> 1.2", ">= 1.2.10"
  • tzinfo-data undefined
  • wdm "~> 0.1.0"
  • kramdown-parser-gfm undefined
github-actions
.github/workflows/build-and-test.yml
  • actions/checkout v3
  • actions/setup-node v3
.github/workflows/codeql-analysis.yml
  • actions/checkout v3
  • github/codeql-action v1
  • github/codeql-action v1
  • github/codeql-action v1
html
docs/_layouts/default.html
  • html5shiv 3.7.3
npm
package.json
  • @graphql-codegen/add 3.2.3
  • @graphql-codegen/cli 2.16.5
  • @graphql-codegen/plugin-helpers 3.1.2
  • @graphql-codegen/schema-ast 2.6.1
  • @graphql-codegen/typescript 2.8.8
  • @graphql-codegen/typescript-resolvers 2.7.13
  • @graphql-codegen/visitor-plugin-common 2.13.8
  • chalk 4.1.2
  • commander 9.5.0
  • dataloader 2.2.2
  • dedent 0.7.0
  • graphql 16.8.1
  • graphql-tag 2.12.6
  • inquirer 8.2.6
  • is-plain-object 5.0.0
  • lodash 4.17.21
  • object-hash 2.2.0
  • prettier 3.0.3
  • type-fest 2.19.0
  • yaml 2.3.3
  • uuid 8.3.2
  • @trivago/prettier-plugin-sort-imports 4.2.0
  • @types/dedent 0.7.0
  • @types/inquirer 8.2.6
  • @types/jest 27.5.2
  • @types/lodash 4.14.195
  • @types/node 18.18.5
  • @types/object-hash 2.2.1
  • @types/sha256 0.2.0
  • @types/uuid 8.3.4
  • @typescript-eslint/eslint-plugin 5.62.0
  • @typescript-eslint/parser 5.62.0
  • @apollo/server 4.9.3
  • bignumber.js 9.1.1
  • eslint 8.51.0
  • jest 27.5.1
  • make-coverage-badge 1.2.0
  • mongodb-memory-server 8.13.0
  • prettier 3.0.3
  • release-it 15.11.0
  • rimraf 3.0.2
  • sha256 0.2.0
  • ts-jest 27.1.5
  • typedoc 0.24.8
  • typescript 4.9.5
  • sqlite3 5.1.4
  • knex 2.5.1
  • mongodb 5.8.0
  • redis 4.6.7
  • node >=12.6
  • pnpm >=6.14.1
  • graphql 16.8.1

  • Check this box to trigger a request for Renovate to run again on this repository

Add an option for clearer `ModelProjection` return

Now ModelProjection utility type return alway an object with the concatenation of the projection (& { __projection: P }). This is useful for a better type checking but it obfuscates the return type of find operations.

Proposal:
add disableProjectionReturn settings in the codegen.yml (default as false) that disable this behaviour.

disableProjectionReturn: false
image

disableProjectionReturn: true
image

Monitoring and alerts

Design a monitoring and alerts management with the ability to:

  • trace slowest operations, most time consuming operations, most invoked operations, ecc
  • show configurable metrics of data access
  • add alerts with configurable thresholds

Support deletion paranoid mode

In paranoid mode all deletions are logic, done by setting a deletedAt date field and every other API should automatically filter for records with deletedAt null.

Migrations

As a first step of a migration tool we can evaluate the introduction of an explicit migration mechanism, where the user write itself the up/down methods of the migration using the driver directly anche the framework only applies the in a secure way.

A second step could be the one where the platform infers the migration from the model, but it requires a strict connection between model and database schema (introspection/generation).

Add `maxDepth` param into find operations

maxDepth: 0 -> relations are disabled
maxDepth: 1 -> only relations attached to the main entity
maxDepth: n -> ...

Add also a default value as the limit (pageSize)

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.