mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 01:42:13 +08:00

Valid MSSQL database names can contain characters like `-`, which need to be escaped when used in queries. This PR wraps database names in `[]`, and fixes Grafana issue #58757.
11 lines
278 B
TypeScript
11 lines
278 B
TypeScript
import { getSchema } from './MSSqlMetaQuery';
|
|
|
|
describe('getSchema', () => {
|
|
const database = 'foo';
|
|
const table = 'bar';
|
|
const schema = getSchema(database, table);
|
|
it('should escapte database names', () => {
|
|
expect(schema).toContain(`USE [${database}]`);
|
|
});
|
|
});
|