Should I append new dialects at the end, or sort them alphabetically? #17294
-
Hi, When adding new For example in it('produces a query to create a table with integer with references', () => {
expectsql(
queryGenerator.createTableQuery('myTable', { myColumn: 'INTEGER REFERENCES "Bar" ("id")' }),
{
default: ...,
'mariadb mysql': ...,
mssql: ...,
'snowflake db2': ...,
ibmi: ...,
hana: ..., // append to the end
},
);
}); But here it looks good to keep the alphabetical order: it('supports the comment option', () => {
expectsql(
() => queryGenerator.createTableQuery('myTable', { myColumn: 'DATE' }, { comment: 'Foo' }),
{
default: ...,
hana: ..., // keep the alphabetical order
'mariadb mysql': ...,
postgres: ...,
snowflake: ...,
},
);
}); Is there any convention on the order of dialects? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No convention yet. We will not enforce that until we have a formatter rule in place for that. I personally prefer putting new dialects at the end, but both are fine. In the case of the createTableQuery unit test file I used the order of the dialects in |
Beta Was this translation helpful? Give feedback.
No convention yet. We will not enforce that until we have a formatter rule in place for that.
I personally prefer putting new dialects at the end, but both are fine.
In the case of the createTableQuery unit test file I used the order of the dialects in
test-unit-all
script of core (which is the same order as in the unit test job in CI)