Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

sequelize: Suggest better regex for opentelemetry-instrumentation-sequelize/utils.js extractTableFromQuery #253

@ray58750034

Description

@ray58750034

Original code: https://github.com/aspecto-io/opentelemetry-ext-js/blob/master/packages/instrumentation-sequelize/src/utils.ts#L3

Suggest regex:

query.match(/(?<=(update|(?<!distinct\s+)from|join|truncate|into)\s+)\"?\`?(\w+)\"?\`?/gi);

Expect to work with following sqls:

UPDATE tableName SET field=value;
INSERT INTO tableName ("field") VALUES (value);
SELECT * FROM tableName WHERE field IS DISTINCT FROM value;

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