Skip to content

Commit

Permalink
more proper quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoy-googly-moogly committed Nov 29, 2024
1 parent 61a7e03 commit cc279c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 101 deletions.
2 changes: 1 addition & 1 deletion packages/malloy/src/dialect/mysql/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class MySQLDialect extends Dialect {
}

sqlMaybeQuoteIdentifier(identifier: string): string {
return `\`${identifier}\``;
return '"' + identifier.replace(/"/g, '""') + '"';
}

// TODO: Check what this is.
Expand Down
100 changes: 0 additions & 100 deletions packages/malloy/src/dialect/standardsql/standardsql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,107 +270,7 @@ ${indent(sql)}
return `(SELECT AS STRUCT ${alias}.*)`;
}

keywords = `
ALL
AND
ANY
ARRAY
AS
ASC
ASSERT_ROWS_MODIFIED
AT
BETWEEN
BY
CASE
CAST
COLLATE
CONTAINS
CREATE
CROSS
CUBE
CURRENT
DEFAULT
DEFINE
DESC
DISTINCT
ELSE
END
ENUM
ESCAPE
EXCEPT
EXCLUDE
EXISTS
EXTRACT
FALSE
FETCH
FOLLOWING
FOR
FROM
FULL
GROUP
GROUPING
GROUPS
HASH
HAVING
IF
IGNORE
IN
INNER
INTERSECT
INTERVAL
INTO
IS
JOIN
LATERAL
LEFT
LIKE
LIMIT
LOOKUP
MERGE
NATURAL
NEW
NO
NOT
NULL
NULLS
OF
ON
OR
ORDER
OUTER
OVER
PARTITION
PRECEDING
PROTO
RANGE
RECURSIVE
RESPECT
RIGHT
ROLLUP
ROWS
SELECT
SET
SOME
STRUCT
TABLESAMPLE
THEN
TO
TREAT
TRUE
UNBOUNDED
UNION
UNNEST
USING
WHEN
WHERE
WINDOW
WITH
WITHIN`.split(/\s/);

sqlMaybeQuoteIdentifier(identifier: string): string {
// return this.keywords.indexOf(identifier.toUpperCase()) > 0
// ? '`' + identifier + '`'
// : identifier;
return '`' + identifier + '`';
}

Expand Down

0 comments on commit cc279c8

Please sign in to comment.