/usr/share/grafana/public/app/plugins/datasource/mysql
import { isValidIdentifier } from './sqlUtil'; describe('isValidIdentifier', () => { test.each([ { value: 'and', expected: false }, // Reserved keyword { value: '1name', expected: false }, // Starts with value { value: 'my-sql', expected: false }, // Contains not permitted character { value: '$id', expected: false }, // $ sign shouldn't be the first character { value: 'my sql', expected: false }, // Whitespace is not permitted { value: 'mysql ', expected: false }, // Whitespace is not permitted at the end { value: ' mysql', expected: false }, // Whitespace is not permitted { value: 'id$', expected: true }, { value: 'myIdentifier', expected: true }, { value: 'table_name', expected: true }, ])('should return $expected when value is $value', ({ value, expected }) => { expect(isValidIdentifier(value)).toBe(expected); }); });
.
Edit
..
Edit
CHANGELOG.md
Edit
CheatSheet.tsx
Edit
MySqlDatasource.ts
Edit
README.md
Edit
configuration
Edit
dist
Edit
fields.ts
Edit
img
Edit
jest-setup.js
Edit
jest.config.js
Edit
module.ts
Edit
mySqlMetaQuery.test.ts
Edit
mySqlMetaQuery.ts
Edit
package.json
Edit
plugin.json
Edit
project.json
Edit
specs
Edit
sqlCompletionProvider.ts
Edit
sqlUtil.test.ts
Edit
sqlUtil.ts
Edit
tsconfig.json
Edit
types.ts
Edit
webpack.config.ts
Edit