github gajus/slonik @slonik/utilities@44.0.0

latest releases: @slonik/types@46.2.0, @slonik/utilities@46.2.0, @slonik/sql-tag@46.2.0...
6 months ago

Convert token types to symbols to ensures that SQL tokens cannot be injected from outside of the codebase, e.g. through JSON.

Thanks to @alxndrsn for reporting the issue and suggesting a patch (#595).

Thanks to @danielrearden for suggesting a patch.

This is only a breaking change if you were previously manually assembling SQL, e.g.

const fooFragment = () => {
  return {
    sql: 'foo',
    type: 'SLONIK_TOKEN_FRAGMENT',
    values: [],
  };
};

This snippet would need to become:

import { FragmentToken } from '@slonik/sql-tag';

const fooFragment = () => {
  return {
    sql: 'foo',
    type: FragmentToken,
    values: [],
  };
};

Don't miss a new slonik release

NewReleases is sending notifications on new releases.