/usr/share/grafana/public/app/plugins/datasource/grafana-postgresql-datasource
import { getSchema } from './postgresMetaQuery'; describe('postgredsMetaQuery.getSchema', () => { it('should handle table-names with single quote', () => { // testing multi-line with single-quote, double-quote, backtick const tableName = `'a''bcd'efg'h' "a""b" ` + '`x``y`z' + `\n a'b''c`; const escapedName = `''a''''bcd''efg''h'' "a""b" ` + '`x``y`z' + `\n a''b''''c`; const schemaQuery = getSchema(tableName); expect(schemaQuery.includes(escapedName)).toBeTruthy(); expect(schemaQuery.includes(tableName)).toBeFalsy(); }); });
.
Edit
..
Edit
CHANGELOG.md
Edit
CheatSheet.tsx
Edit
PostgresQueryEditor.tsx
Edit
PostgresQueryModel.ts
Edit
README.md
Edit
configuration
Edit
datasource.test.ts
Edit
datasource.ts
Edit
dist
Edit
img
Edit
jest-setup.js
Edit
jest.config.js
Edit
module.ts
Edit
package.json
Edit
plugin.json
Edit
postgresMetaQuery.test.ts
Edit
postgresMetaQuery.ts
Edit
project.json
Edit
sqlCompletionProvider.ts
Edit
sqlUtil.ts
Edit
tsconfig.json
Edit
types.ts
Edit
webpack.config.ts
Edit