Conjure SQL from GraphQL queries 🧙🔮✨

Overview

Sqlmancer

Conjure SQL from your GraphQL queries 🧙 🔮

GitHub package.json version GitHub Build Status Coverage Status Language grade: JavaScript Discord

⚠️ This project is currently on hiatus. I am hoping to resume working on Sqlmancer once I have some more free time. Feel free to submit new issues for feature requests or bug reports, although I may not address them immediately.

Sqlmancer is a Node.js library for integrating SQL with GraphQL. It empowers you to effortlessly and efficiently translate GraphQL queries into SQL statements.

How it works

Sqlmancer generates a fluent, type-safe database client from your schema based on metadata you provide through schema directives. With Sqlmancer, your resolver can be as simple as this:

function resolve (root, args, ctx, info) {
  return Film.findMany().resolveInfo(info).execute();
}

while still allowing complex queries like this:

Show query
query FilmQuery {
  films(
    where: {
      or: [
        { budget: { greaterThanOrEqual: 50000000 } },
        { language: { name: { in: ["Spanish", "French"] } } },
      ]
      actors: { count: { lessThan: 50 } },
    },
    orderBy: [{
      actors: { avg: { popularity: DESC } }
    }],
    limit: 100
  ) {
    id
    title
    actors(
      orderBy: [{
        popularity: DESC
      }],
      limit: 10
    ) {
      id
      firstName
      lastName
      films(
        orderBy: [{
          films: { min: { budget: ASC } }
        }]
        limit: 5
      ) {
        id
        title
      }
    }
  }
}

Features

  • Multiple dialect support. Sqlmancer supports Postgres, MySQL, MariaDB and SQLite, enabling you to incorporate it into existing projects regardless of what flavor of SQL you're using.
  • Robust filtering and sorting. Add complex filtering and sorting to your queries, including filtering using logical operators and filtering and sorting by fields and aggregate fields of related models.
  • Arbitrarily deep nesting. Define one-to-one, one-to-many and many-to-many relationships between models. Related models can be filtered, sorted and paginated just like root-level fields.
  • Performance. Avoid the N+1 problem by building a single SQL query to fetch all necessary data, regardless of query depth.
  • Mutations made easy. Create, update and delete records, with or without transactions, using a simple, fluent API. Easily provide WHERE, ORDER BY and LIMIT clauses to your queries when updating and deleting records.
  • Views and CTEs. Take advantage of existing views in your database and create inline ones using common table expressions.
  • Custom scalars. Use the scalars that make sense for your schema.
  • Abstract types. Utilize unions and interfaces in your schema using views or single table inheritance.

Design goals

  • Annotation over transformation. Sqlmancer aims to be as aspect-oriented as possible, with directives being used mostly to annotate your schema rather than outright change its behavior.
  • Limited type-generation. Sqlmancer offers a number of convenient directives to generate arguments or types, but these directives are never required for Sqlmancer to work its magic. What types are exposed in the schema is ultimately left up to you.
  • More than just CRUD. Sqlmancer empowers you to create the queries and mutations that are right for your schema.
  • Flexible and unopinionated. Sqlmancer enabled you to easily add features like authorization, tracing, cost analysis and depth limits using existing libraries without paying for a "pro" version.

See the official documentation for API reference, guides and more.

Community

If you found a bug, have a feature request or want to contribute to the project, please open an issue. If you need help or have a question, you can ask on Stack Overflow or come chat with us on Discord!

Contributors

Thanks goes to these wonderful people (emoji key):


Daniel Rearden

💻 📖 🤔

Pavel Ravits

📖

Tadej Stanic

🐛

Tristan Siegel

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • Count returns not the total count but the count of returned results

    Count returns not the total count but the count of returned results

    I mean if the limit=5 and results length is 5, count = 5 Is it intended? What I expect is count = number of filtered rows without limit

        type Order @model(table: "orders", pk: "id") {
            id: ID!
            clientId: ID!
            clientUserId: ID!
            createdAt: String
            status: String
            paymentId: String
            amount: String
            productCode: String
            quantity: String
        }
    
        type Query @sqlmancer(dialect: POSTGRES, transformFieldNames: SNAKE_CASE) {
            hello(name: String): String
            isAuth: AuthPayload!
            orders: Order @many @paginate
        }
    
            async orders(_, __, { sql, client }, info) {
                isAuth
                return client.models.Order.paginate().count().selectAll().resolveInfo(info).execute()
            },
    
    enhancement 
    opened by lishine 17
  • Add aggregate queries and aggregate joins

    Add aggregate queries and aggregate joins

    Add ability to query aggregate values and do aggregate joins. In order to support querying aggregate values, a new aggregate query builder would need to be added and included in the database client. The findOne, findMany and findById query builders would need to support a new join method. Either the existing @join directive would need to be modified to support aggregate joins, or else a new directive would need to be added.

    The resulting query might look something like this:

    {
      modelsAggregate {
        count
        min {
          someField
        }
        avg {
          someOtherField
        }
      }
    }
    

    This mirrors existing implementations, like Hasura's, but results in a very nested structure. Alternatively, we could expose a single field with an input, for example:

    {
      modelsCount: modelsAggregate(func: count)
      minSomeField: modelsAggregate(func: min, field: someField)
      avgSomeOtherField: modelsAggregate(func: avg, field: someOtherField)
    }
    

    The biggest downside is that using a single field like this would mean using Float even when Int would be appropriate (e.g. for count) but maybe we can live with that.

    enhancement 
    opened by danielrearden 11
  • Order by not working?

    Order by not working?

    Using the sandbox example here, the following query does not order as expected:

    {
      customers {
        lastName
        invoices (orderBy: {customer:{lastName:ASC}}){
          total
        }
      }
    }
    

    A partial result is shown below: image

    It seems that ASC nor DESC order appropriately.

    question 
    opened by JeffML 8
  • Question - athorization

    Question - athorization

    What would be the recommended approach to limit orders (order has customerId field) query only to users that are associated with these customers in a connected table customerUsers(userId, customerId) ? resolver of orders

            async orders(_, __, { client, userId }, info) {
                return client.models.Order.paginate().count().selectAll().resolveInfo(info).execute()
            },
    

    userId comes from the context

    1. Inner join (using knex??, is it possible at all to use knex with sqlmancer client?) with customerUsers(where userId = contextUserId)
    2. Somehow complement the request to be
    query {
       orders {
          users(where: { userId: contextUserId})
       }
    }
    
    1. Something like graphql-shield (I don't know yet if it is feasible)
    2. Permissions on postgres itself (have to investigate, I don't know yet anything about it)
    question 
    opened by lishine 7
  • Documentation

    Documentation

    Hi Daniel,

    Link with this text before it is broken: Read more about defining models.

    Questions: What is the background for creating this lib and even with support for many databases? You are using it at your work? There is prisma, how is it compares, why create something similar?

    documentation question 
    opened by lishine 5
  • Bump @typescript-eslint/parser from 3.5.0 to 3.6.0

    Bump @typescript-eslint/parser from 3.5.0 to 3.6.0

    Bumps @typescript-eslint/parser from 3.5.0 to 3.6.0.

    Release notes

    Sourced from @typescript-eslint/parser's releases.

    v3.6.0

    3.6.0 (2020-07-06)

    Bug Fixes

    • eslint-plugin: [no-namespace] allow namespaces in nested declarations with allowDeclarations (#2238) (c1df669)
    • eslint-plugin: [space-before-function-paren] handle abstract functions (#2199) (88a3edf)

    Features

    • eslint-plugin: add rule prefer-literal-enum-member (#1898) (fe2b2ec)
    Changelog

    Sourced from @typescript-eslint/parser's changelog.

    3.6.0 (2020-07-06)

    Note: Version bump only for package @typescript-eslint/parser

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 4
  • Bump eslint-plugin-jest from 23.17.1 to 23.18.0

    Bump eslint-plugin-jest from 23.17.1 to 23.18.0

    Bumps eslint-plugin-jest from 23.17.1 to 23.18.0.

    Release notes

    Sourced from eslint-plugin-jest's releases.

    v23.18.0

    23.18.0 (2020-07-05)

    Features

    • valid-title: support mustMatch & mustNotMatch options (#608) (4c7207e), closes #233
    Changelog

    Sourced from eslint-plugin-jest's changelog.

    23.18.0 (2020-07-05)

    Features

    • valid-title: support mustMatch & mustNotMatch options (#608) (4c7207e), closes #233
    Commits
    • 73efaea chore(release): 23.18.0 [skip ci]
    • 4c7207e feat(valid-title): support mustMatch & mustNotMatch options (#608)
    • 94fa724 chore: build recommended ruleset based on rules meta doc property (#615)
    • 6b86aa4 chore: replace scripts with single prepack script (#606)
    • c4f8c97 chore: refresh lockfile (#617)
    • 92c2652 chore(deps): update dependency jest-runner-eslint to ^0.10.0 (#616)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • Bump graphql-scalars from 1.1.5 to 1.2.1

    Bump graphql-scalars from 1.1.5 to 1.2.1

    Bumps graphql-scalars from 1.1.5 to 1.2.1.

    Release notes

    Sourced from graphql-scalars's releases.

    1.1.7

    Contact us here for help, more necessary open source tools and Enterprise support or Chat with us on discord

    • Support the environments that don't have BigInt implementation

    1.1.6

    Contact us here for help, more necessary open source tools and Enterprise support or Chat with us on discord

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • Trouble adding `@paginate` directives

    Trouble adding `@paginate` directives

    I've added @paginate and it breaks on many to many relationships, and I'm not sure if I'm using it incorrectly for other custom resolvers.

      type Query @sqlmancer(dialect: POSTGRES, transformFieldNames: SNAKE_CASE, customScalars: { JSON: ["JSON", "JSONObject"], Date: ["DateTime"] }) {
        post(slug: String!): Post
        posts: [Post!]! @paginate
      }
      type Post @model(table: "posts", pk: "id") {
        id: ID!
        mobiledoc: String!
        slug: String!
        title: String!
        createdAt: String!
        publishedAt: String
        authors: [Author!]! @relate(
          through: "posts_authors",
          on: [{ from: "id", to: "post_id" }, { from: "author_id", to: "id" }]
        ) @paginate
      }
      type Author @model(table: "authors", pk: "id") {
        id: ID!
        name: String!
        email: String!
        posts: [Post!]! @relate(
          through: "posts_authors",
          on: [{ from: "id", to: "author_id" }, { from: "post_id", to: "id" }]
        )
      }
    
    {
        Query: {
          async post(parent, args, ctx, info) {
            return client.models.Post.findOne()
              .where({ slug: { equal: args.slug } })
              .resolveInfo(info)
              .execute()
          },
          async posts(parent, args, ctx, info) {
            return client.models.Post.findMany()
              .orderBy([{ publishedAt: 'DESC' }])
              .resolveInfo(info)
              .execute()
          }
        },
        Post: {},
        Author: {},
      }
    

    For both I'm seeing errors about results not returning a non-null field for <TypeName>Page.results. I'm not sure if maybe there's something I need to do in the resolvers or not to make this work but returning { results: <some data> }

    {
      "errors": [
        {
          "message": "Cannot return null for non-nullable field PostPage.results.",
          "locations": [
            {
              "line": 3,
              "column": 5
            }
          ],
          "path": [
            "posts",
            "results"
          ],
          "extensions": {
            "code": "INTERNAL_SERVER_ERROR",
            "exception": {
              "stacktrace": [
                "Error: Cannot return null for non-nullable field PostPage.results.",
                "    at completeValue (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:560:13)",
                "    at completeValueCatchingError (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:495:19)",
                "    at resolveField (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:435:10)",
                "    at executeFields (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:275:18)",
                "    at collectAndExecuteSubfields (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:713:10)",
                "    at completeObjectValue (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:703:10)",
                "    at completeValue (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:591:12)",
                "    at completeValue (/Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:557:21)",
                "    at /Users/tristan/code/thedipp/api.thedipp.com/node_modules/graphql/execution/execute.js:492:16",
                "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
              ]
            }
          }
        }
      ],
      "data": null
    }
    
    question 
    opened by tsiege 3
  • Bump @graphql-toolkit/core from 0.10.5 to 0.10.7

    Bump @graphql-toolkit/core from 0.10.5 to 0.10.7

    Bumps @graphql-toolkit/core from 0.10.5 to 0.10.7.

    Release notes

    Sourced from @graphql-toolkit/core's releases.

    v0.10.7

    Do you want The Guild to keep your codebase up to date and run your build on each GraphQL Toolkit commit so we will make sure not to break your app? Contact us here: the-guild.dev/connected-build Chat with us on discord

    List of changes:

    • Fixed issues with extensions not defined
    • Update deps

    v0.10.6

    Do you want The Guild to keep your codebase up to date and run your build on each GraphQL Toolkit commit so we will make sure not to break your app? Contact us here: the-guild.dev/connected-build Chat with us on discord

    List of changes:

    Commits
    • ac0aac7 v0.10.7
    • 22eaff9 fix for exceptions while merging extensions
    • 63cda19 Update dependency simple-git to v2.5.0
    • b6a2cbc Update dependency @types/fs-extra to v8.1.1
    • 572d2d3 Update dependency @types/jest to v25.2.2
    • 66633d8 Update dependency @types/lodash to v4.14.151
    • 0df83ff Update dependency ts-jest to v25.5.1
    • 0d236d3 Update dependency ts-jest to v25.5.0
    • 8d16e03 Update dependency tslib to v1.11.2
    • 195e2d1 Update dependency jest to v26 (#595)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 3
  • Bump commander from 5.0.0 to 5.1.0

    Bump commander from 5.0.0 to 5.1.0

    Bumps commander from 5.0.0 to 5.1.0.

    Release notes

    Sourced from commander's releases.

    v5.1.0

    Added

    • support for multiple command aliases, the first of which is shown in the auto-generated help (#531, #1236)
    • configuration support in addCommand() for hidden and isDefault (#1232)

    Fixed

    • omit masked help flags from the displayed help (#645, #1247)
    • remove old short help flag when change help flags using helpOption (#1248)

    Changed

    • remove use of arguments to improve auto-generated help in editors (#1235)
    • rename .command() configuration noHelp to hidden (but not remove old support) (#1232)
    • improvements to documentation
    • update dependencies
    • update tested versions of node
    • eliminate lint errors in TypeScript (#1208)
    Changelog

    Sourced from commander's changelog.

    [5.1.0] (2020-04-25)

    Added

    • support for multiple command aliases, the first of which is shown in the auto-generated help (#531, #1236)
    • configuration support in addCommand() for hidden and isDefault (#1232)

    Fixed

    • omit masked help flags from the displayed help (#645, #1247)
    • remove old short help flag when change help flags using helpOption (#1248)

    Changed

    • remove use of arguments to improve auto-generated help in editors (#1235)
    • rename .command() configuration noHelp to hidden (but not remove old support) (#1232)
    • improvements to documentation
    • update dependencies
    • update tested versions of node
    • eliminate lint errors in TypeScript (#1208)
    Commits
    • 6405325 Prepare for release (#1255)
    • 8c9cfbb Add Node.js 14 to the CI settings of GitHub Actions (#1253)
    • b8baafb Update dependencies (#1251)
    • e1966fc Omit the help flags from help that are masked by other options (#1247)
    • 56221f7 Allow helpOption to only include long flag (#1248)
    • 28e8d3f Add support for multiple aliases (#1236)
    • b59adfc Replace use of arguments.length (#1235)
    • b5d95ee Add opts to addCommand, and rename noHelp to hidden (#1232)
    • 8ec3e7f Consistently refer to returning this for chaining (not parent) (#1231)
    • 2c0a237 Remove most uses of top-level, as less accurate now with command nesting. (#1...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 3
  • Bump husky from 4.2.5 to 8.0.3

    Bump husky from 4.2.5 to 8.0.3

    Bumps husky from 4.2.5 to 8.0.3.

    Release notes

    Sourced from husky's releases.

    v8.0.3

    • fix: add git not installed message #1208

    v8.0.2

    • docs: remove deprecated npm set-script

    v8.0.1

    • fix: use POSIX equality operator

    v8.0.0

    What's Changed

    Feats

    • feat: add husky - prefix to logged global error messages by @​joshbalfour in typicode/husky#1092
    • feat: show PATH when command not found to improve debuggability
    • feat: drop Node 12 support
    • feat: skip install if $HUSKY=0

    Fixes

    Docs

    Chore

    v7.0.4

    No changes. Husky v7.0.3 was reverted, this version is the same as v7.0.2.

    v7.0.2

    Fix pre-commit hook in WebStorm (#1023)

    v7.0.1

    • Fix gracefully fail if Git command is not found #1003 (same as in v6)

    v7.0.0

    • Improve .husky/ directory structure. .husky/.gitignore is now unnecessary and can be removed.
    • Improve error output (shorter)
    • Update husky-init CLI
    • Update husky-4-to-7 CLI
    • Drop Node 10 support

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump sqlite3 from 5.0.0 to 5.1.4

    Bump sqlite3 from 5.0.0 to 5.1.4

    Bumps sqlite3 from 5.0.0 to 5.1.4.

    Release notes

    Sourced from sqlite3's releases.

    v5.1.4

    What's Changed

    Full Changelog: https://github.com/TryGhost/node-sqlite3/compare/v5.1.3...v5.1.4

    v5.1.3

    What's Changed

    Full Changelog: https://github.com/TryGhost/node-sqlite3/compare/v5.1.2...v5.1.3

    v5.1.2

    What's Changed

    Full Changelog: https://github.com/TryGhost/node-sqlite3/compare/v5.1.1...v5.1.2

    v5.1.1

    What's Changed

    A huge thanks to MacStadium for providing an M1 Mac Mini so we can offer ARM64 binaries.

    Full Changelog: https://github.com/TryGhost/node-sqlite3/compare/v5.1.0...v5.1.1

    v5.1.0

    ✨ We're very excited to announce node-sqlite3's first minor release of v5, packed with features and improvements.

    If you encounter any problems, please open a detailed issue using the templates.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/TryGhost/node-sqlite3/compare/v5.0.11...v5.1.0

    v5.0.11

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by daniellockyer, a new releaser for sqlite3 since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump qs from 6.5.2 to 6.5.3

    Bump qs from 6.5.2 to 6.5.3

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 0
  • Bump graphql-middleware from 4.0.2 to 6.1.33

    Bump graphql-middleware from 4.0.2 to 6.1.33

    Bumps graphql-middleware from 4.0.2 to 6.1.33.

    Release notes

    Sourced from graphql-middleware's releases.

    v6.1.33

    6.1.33 (2022-10-07)

    Bug Fixes

    v6.1.32

    6.1.32 (2022-07-27)

    Bug Fixes

    v6.1.31

    6.1.31 (2022-06-27)

    Bug Fixes

    v6.1.30

    6.1.30 (2022-06-24)

    Bug Fixes

    v6.1.29

    6.1.29 (2022-06-07)

    Bug Fixes

    v6.1.28

    6.1.28 (2022-05-20)

    Bug Fixes

    v6.1.27

    6.1.27 (2022-05-20)

    ... (truncated)

    Commits
    • 1c33515 fix(deps): graphql v16 (#556)
    • 832b510 fix(deps): update graphql-tools monorepo (#548)
    • fe05332 fix(deps): update graphql-tools monorepo (#546)
    • c98646a fix(deps): update graphql-tools monorepo (#545)
    • a63f633 chore(deps): update dependency typescript to ^4.7.4 (#544)
    • 5c06a4a chore(deps): update dependency prettier to ^2.7.1 (#543)
    • 6d24856 chore(deps): update dependency prettier to ^2.7.0 (#542)
    • c8f57a9 fix(deps): update graphql-tools monorepo (#540)
    • 8019b33 chore(deps): update dependency typescript to ^4.7.3 (#539)
    • 6218d52 chore(deps): update dependency apollo-server to ^2.25.4 (#538)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump commander from 5.1.0 to 9.4.1

    Bump commander from 5.1.0 to 9.4.1

    Bumps commander from 5.1.0 to 9.4.1.

    Release notes

    Sourced from commander's releases.

    v9.4.1

    Fixed

    • .setOptionValue() now also clears option source (#1795)
    • TypeScript: add implied to OptionValueSource for option values set by using .implies() (#1794)
    • TypeScript : add undefined to return type of .getOptionValueSource() (#1794)

    Changed

    • additions to README

    v9.4.0

    Added

    • preSubcommand hook called before direct subcommands (#1763)

    Fixed

    • export InvalidOptionArgumentError in esm (#1756)

    Changed

    • update dependencies (#1767)

    v9.3.0

    Added

    • .summary() for a short summary to use instead of description when listing subcommands in help (#1726)
    • Option.implies() to set other option values when the option is specified (#1724)
    • updated Chinese README with 9.x changes (#1727)

    Fixed

    • TypeScript: add string[] to .options() default value parameter type for use with variadic options (#1721)

    Deprecated

    • multi-character short option flag (e.g. -ws) (#1718)

    v9.2.0

    Added

    • conditional export of 'types' for upcoming TypeScript module resolution (#1703)
    • example file showing two ways to add global options to subcommands (#1708)

    Fixed

    • detect option conflicts in parent commands of called subcommand (#1710)

    Changed

    ... (truncated)

    Changelog

    Sourced from commander's changelog.

    [9.4.1] (2022-09-30)

    Fixed

    • .setOptionValue() now also clears option source (#1795)
    • TypeScript: add implied to OptionValueSource for option values set by using .implies() (#1794)
    • TypeScript : add undefined to return type of .getOptionValueSource() (#1794)

    Changed

    • additions to README

    [9.4.0] (2022-07-15)

    Added

    • preSubcommand hook called before direct subcommands (#1763)

    Fixed

    • export InvalidOptionArgumentError in esm (#1756)

    Changed

    • update dependencies (#1767)

    [9.3.0] (2022-05-28)

    Added

    • .summary() for a short summary to use instead of description when listing subcommands in help (#1726)
    • Option.implies() to set other option values when the option is specified (#1724)
    • updated Chinese README with 9.x changes (#1727)

    Fixed

    • TypeScript: add string[] to .options() default value parameter type for use with variadic options (#1721)

    Deprecated

    • multi-character short option flag (e.g. -ws) (#1718)

    [9.2.0] (2022-04-15)

    Added

    • conditional export of 'types' for upcoming TypeScript module resolution (#1703)
    • example file showing two ways to add global options to subcommands (#1708)

    Fixed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v0.3.2)
  • v0.3.2(Jun 8, 2020)

  • v0.3.1(Jun 8, 2020)

  • v0.3.0(May 21, 2020)

    0.3.0 - 2020-05-20

    Added

    • totalCount property to object returned by paginate

    Fixed

    • Return type generated by @paginate
    • Private fields being used in type generation
    • Selection set not modifying selected columns
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(May 15, 2020)

  • v0.2.0(May 13, 2020)

    0.2.0 - 2020-05-13

    Added

    • Support for MySQL, MariaDB and SQLite
    • Support for pagination and aggregation through paginate method and @paginate directive
    • @sqlmancer directive for providing configuration options
    • @many directive to be used instead of @limit, @offset, @where, and @orderBy
    • @input directive for generating input types from models
    • Custom scalars configuration
    • Watch command for CLI

    Changed

    • Client is now built at runtime instead of generating the client code beforehand
    • CLI now builds TypeScript typings only instead of entire client
    • findOne, findMany and findById now select all available fields by default

    Removed

    • Option to provide additional configuration file (all configuration is now provided through SDL)
    Source code(tar.gz)
    Source code(zip)
Owner
Daniel Rearden
Backend lead @ Contra • GraphQL enthusiast • He/him • I develop people and applications 🌱
Daniel Rearden
Run SPARQL/SQL queries directly on Virtuoso database with connection pool support.

?? virtuoso-connector Package that allows you to create a direct connection to the Virtuoso database and run queries on it. Connection can be used to

Tomáš Dvořák 6 Nov 15, 2022
Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL.

SafeQL Write SQL Queries With Confidence • Get started Install I would first recommend follow the instructions in the documentation. npm install --sav

null 747 Dec 28, 2022
Connect to private Google Cloud SQL instance through Cloud SQL Auth Proxy running in Kubernetes.

⛅ google-cloud-sql A CLI app which establishes a connection to a private Google Cloud SQL instance and port-forwards it to a local machine. Connection

Dinko Osrecki 10 Oct 16, 2022
just a graphql example created by typescript + fastify + mikro-orm(postgresql) + mercurius(graphql adaptor) + type-graphql

fastify-mikro-orm-mercurius-graphql-example A MikroORM boilerplate for GraphQL made with Fastify, Mercurius, Typescript using TypeGraphQL ?? Packages

Vigen 10 Aug 28, 2022
StashQL is a light-weight, open-source npm package that improves the speed of your GraphQL queries in your application.

Table of Contents What is StashQL? Install Getting Started Queries Mutations refillCache clearRelatedFields Logging The Team What is StashQL? StashQL

OSLabs Beta 67 Sep 30, 2022
curl for GraphQL with autocomplete, subscriptions and GraphiQL. Also a dead-simple universal javascript GraphQL client.

graphqurl graphqurl is a curl like CLI for GraphQL. It's features include: CLI for making GraphQL queries. It also provisions queries with autocomplet

Hasura 3.2k Jan 3, 2023
GraphQL Fastify Server is an implementation of GraphQL.

GraphQL Fastify Server Installation Usage Using cache Middlewares Liveness & Readiness Contributing License Installation npm install --save graphql-fa

Rui Silva 33 Dec 19, 2022
Nodeparse - A lightweight, vanilla replacement for Express framework when parsing the HTTP body's data or parsing the URL parameters and queries with NodeJS.

nodeparse A lightweight, vanilla replacement for Express framework when parsing the HTTP body's data or parsing the URL parameters and queries with No

Trần Quang Kha 1 Jan 8, 2022
An easy-to-use multi SQL dialect ORM tool for Node.js

Sequelize Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction s

Sequelize 27.3k Jan 4, 2023
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.

Lovefield Lovefield is a relational database written in pure JavaScript. It provides SQL-like syntax and works cross-browser (currently supporting Chr

Google 6.8k Jan 3, 2023
An SQL-friendly ORM for Node.js

Objection.js Objection.js is an ORM for Node.js that aims to stay out of your way and make it as easy as possible to use the full power of SQL and the

Vincit 6.9k Jan 5, 2023
AlaSQL.js - JavaScript SQL database for browser and Node.js. Handles both traditional relational tables and nested JSON data (NoSQL). Export, store, and import data from localStorage, IndexedDB, or Excel.

Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a

Andrey Gershun 6.1k Jan 9, 2023
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server & SQLite

Prisma Quickstart • Website • Docs • Examples • Blog • Slack • Twitter • Prisma 1 What is Prisma? Prisma is a next-generation ORM that consists of the

Prisma 28k Jan 2, 2023
An adapter-based ORM for Node.js with support for mysql, mongo, postgres, mssql (SQL Server), and more

Waterline is a next-generation storage and retrieval engine, and the default ORM used in the Sails framework. It provides a uniform API for accessing

Balderdash 5.4k Jan 4, 2023
Microsoft SQL Server client for Node.js

node-mssql Microsoft SQL Server client for Node.js Supported TDS drivers: Tedious (pure JavaScript - Windows/macOS/Linux, default) Microsoft / Contrib

null 2.1k Jan 4, 2023
TypeScript clients for databases that prevent SQL Injection

Safe From HTML Injection Using tagged template literals for queries, e.g. db.query(sql`SELECT * FROM users WHERE id=${userID}`); makes it virtually im

Forbes Lindesay 478 Dec 21, 2022
A simple url shorter API built with nodejs running on Kubernetes in Google Cloud, using PostgreSQL for storage and cloud sql proxy.

Simple URL Shorter - Google Cloud - Kubernetes A simple url shorter API built with nodejs running on Kubernetes in Google Cloud, using PostgreSQL for

null 3 Nov 25, 2021