Skip to content

CHAR_LENGTH not supported in ALASQL #1194

@efbenson

Description

@efbenson

Building Experience Builders to use our koop layers, we have run into queries that include CHAR_LENGTH. Koop throws errors as it is not supported by ALASQL per https://github.com/AlaSQL/alasql/wiki/SQL-keywords

TypeError: alasql.fn.CHAR_LENGTH is not a function

I was able to work around it with patching in a custom function in @koopjs/winnow/src/filter-and-transform/filter-and-transform.js

sql.fn.CHAR_LENGTH = function(value) {
  if (value === null || value === undefined) {
    return null;
  }
  return String(value).length;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions