Skip to content

Releases: ts-safeql/safeql

@ts-safeql/shared@0.0.3

20 Sep 22:34
3c7f84b
Compare
Choose a tag to compare

Patch Changes

  • 69b874e: you can now override the default types (e.g. timestamp -> DateTime) by adding an overrides property to the config:

    // safeql.config.ts
    import { definedConfig } from "@ts-safeql/eslint-plugin";
    
    export default definedConfig({
      // ...
      overrides: {
        types: {
          timestamp: "DateTime",
        },
      },
    });

    or

    // .eslintrc.json
    {
      // ...
      "connections": {
        // ...,
        "overrides": {
          "types": {
            "timestamp": "DateTime"
          }
        }
      }
    }

@ts-safeql/generate@0.0.3

20 Sep 22:34
3c7f84b
Compare
Choose a tag to compare

Patch Changes

  • 69b874e: you can now override the default types (e.g. timestamp -> DateTime) by adding an overrides property to the config:

    // safeql.config.ts
    import { definedConfig } from "@ts-safeql/eslint-plugin";
    
    export default definedConfig({
      // ...
      overrides: {
        types: {
          timestamp: "DateTime",
        },
      },
    });

    or

    // .eslintrc.json
    {
      // ...
      "connections": {
        // ...,
        "overrides": {
          "types": {
            "timestamp": "DateTime"
          }
        }
      }
    }
  • Updated dependencies [69b874e]

    • @ts-safeql/shared@0.0.3
    • @ts-safeql/test-utils@0.0.3

@ts-safeql/eslint-plugin@0.0.11

20 Sep 22:34
3c7f84b
Compare
Choose a tag to compare

Patch Changes

  • 69b874e: you can now override the default types (e.g. timestamp -> DateTime) by adding an overrides property to the config:

    // safeql.config.ts
    import { definedConfig } from "@ts-safeql/eslint-plugin";
    
    export default definedConfig({
      // ...
      overrides: {
        types: {
          timestamp: "DateTime",
        },
      },
    });

    or

    // .eslintrc.json
    {
      // ...
      "connections": {
        // ...,
        "overrides": {
          "types": {
            "timestamp": "DateTime"
          }
        }
      }
    }
  • Updated dependencies [69b874e]

    • @ts-safeql/generate@0.0.3
    • @ts-safeql/shared@0.0.3
    • @ts-safeql/test-utils@0.0.3

@ts-safeql/eslint-plugin@0.0.10

20 Sep 07:54
880eb72
Compare
Choose a tag to compare

Patch Changes

  • 1a55018: allow to compare actual type against type reference (sql)

@ts-safeql/eslint-plugin@0.0.9

18 Sep 16:59
3459137
Compare
Choose a tag to compare

Patch Changes

  • 853f943: fixed an issue where using a config file with invalid state kept a temporary config file

@ts-safeql/eslint-plugin@0.0.8

18 Sep 16:19
77ae05d
Compare
Choose a tag to compare

Patch Changes

  • c639958: - connections can now be a single connection object instead of an array of connections.

    • by setting {"useConfigFile": true }, the plugin will use the safeql.config.ts file to get the connection/s information:
    // .eslintrc.json
    {
      // ...
      "rules": {
        "@ts-safeql/check-sql": ["error", { "useConfigFile": true }]
      }
    }
    // safeql.config.ts
    import { defineConfig } from "@ts-safeql/eslint-plugin";
    
    export default defineConfig({
      connections: {
        // ...
      },
    });

    By moving the configuration into a .ts file, we get full auto-completion, which should help configure the connections and find errors.

    Please note that safeql.config.ts should be at the root of your project.

@ts-safeql/eslint-plugin@0.0.7

16 Sep 12:10
41258e9
Compare
Choose a tag to compare

Patch Changes

  • 6b99b38: improve sql migrations detection by deeply lookup inside the specified migrationsDir

@ts-safeql/sql-tag@0.1.0

15 Sep 22:42
Compare
Choose a tag to compare

Minor Changes

  • 13a33b4: Introducing a new package @ts-safeql/sql-tag. It's an sql template tag that is meant to use with sql libraries that doesn't have a built-in support for sql template tags such as node-pg, and sequelize.

@ts-safeql/eslint-plugin@0.0.6

15 Sep 22:39
Compare
Choose a tag to compare

Patch Changes

  • 557d419: Improve type inference for non-table columns

@ts-safeql/eslint-plugin@0.0.5

14 Sep 13:57
2f7d14d
Compare
Choose a tag to compare

Patch Changes

  • 30c5b98: Tag-only types are now available using the "tagName" setting:

    For example (Postgres.js):

    {
      "databaseUrl": "postgres://postgres:postgres@localhost:5432/safeql_postgresjs_demo",
      "tagName": "sql",
      "transform": "${type}[]"
    }
    import { sql } from "postgres";
    
    const query = sql`SELECT id FROM users`;
                  ^^^ // Error: Query is missing type annotation
    
    // After: ✅
    const query = sql<{ id: number; }[]>`SELECT id FROM users`;