Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions docs/public/cud-demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,35 @@ const defaultFormatOptions = {
"indentSize": 4,
"indentChar": "space",
"newline": "lf",
"keywordCase": "lower",
"keywordCase": "upper",
"commaBreak": "before",
"cteCommaBreak": "after",
"valuesCommaBreak": "before",
"andBreak": "before",
"orBreak": "before",
"joinOnBreak": "before",
"joinConditionContinuationIndent": false,
"identifierCase": "preserve",
"expressionWidth": 50,
"lineWrapping": false,
"exportComment": "full",
"commentStyle": "block",
"withClauseStyle": "standard",
"parenthesesOneLine": true,
"indentNestedParentheses": true,
"betweenOneLine": true,
"valuesOneLine": false,
"joinOneLine": true,
"caseOneLine": false,
"subqueryOneLine": false,
"sourceAliasStyle": "as",
"orderByDefaultDirectionStyle": "omit",
"castStyle": "standard",
"constraintStyle": "postgres",
"insertColumnsOneLine": true,
"whenOneLine": false
"whenOneLine": false,
"oneLineMaxLength": 100,
"joinConditionOrderByDeclaration": false
};

// Initialize CodeMirror editors immediately
Expand Down
53 changes: 22 additions & 31 deletions docs/public/demo/style-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const DEFAULT_STYLE_BASE = {
"indentSize": 4,
"indentChar": "space",
"newline": "lf",
"keywordCase": "lower",
"keywordCase": "upper",
"commaBreak": "before",
"cteCommaBreak": "before",
"cteCommaBreak": "after",
"valuesCommaBreak": "before",
"andBreak": "before",
"orBreak": "before",
"joinOnBreak": "none",
"joinOnBreak": "before",
"joinConditionContinuationIndent": false,
"exportComment": "full",
"commentStyle": "block",
Expand All @@ -34,6 +34,17 @@ const DEFAULT_STYLE_BASE = {
"constraintStyle": "postgres"
};

const DEFAULT_POSTGRES_STYLE = {
...DEFAULT_STYLE_BASE,
"constraintStyle": "postgres",
"identifierEscape": "quote",
"identifierEscapeTarget": "minimal",
"parameterSymbol": "$",
"parameterStyle": "indexed",
"sourceAliasStyle": "as",
"castStyle": "postgres"
};

const DEFAULT_STYLES = {
"Default": {
...DEFAULT_STYLE_BASE,
Expand All @@ -49,41 +60,24 @@ const DEFAULT_STYLES = {
"identifierEscapeTarget": "all",
"parameterSymbol": ":",
"parameterStyle": "named",
"keywordCase": "lower",
"keywordCase": "upper",
"sourceAliasStyle": "as",
"castStyle": "standard",
"constraintStyle": "postgres",
"orderByDefaultDirectionStyle": "omit"
},
"Postgres": {
...DEFAULT_STYLE_BASE,
"identifierEscape": "quote",
"identifierEscapeTarget": "all",
"parameterSymbol": "$",
"parameterStyle": "indexed",
"keywordCase": "upper",
"sourceAliasStyle": "as",
"castStyle": "postgres",
"constraintStyle": "postgres"
...DEFAULT_POSTGRES_STYLE
},
"Postgres Minimal": {
...DEFAULT_STYLE_BASE,
"identifierEscape": "quote",
"identifierEscapeTarget": "minimal",
"parameterSymbol": "$",
"parameterStyle": "indexed",
"keywordCase": "lower",
"sourceAliasStyle": "implicit",
"castStyle": "postgres",
"constraintStyle": "postgres"
...DEFAULT_POSTGRES_STYLE
},
"MySQL": {
...DEFAULT_STYLE_BASE,
"identifierEscape": "backtick",
"identifierEscapeTarget": "all",
"identifierEscapeTarget": "minimal",
"parameterSymbol": "?",
"parameterStyle": "anonymous",
"keywordCase": "upper",
"sourceAliasStyle": "as",
"castStyle": "standard",
"constraintStyle": "mysql"
Expand All @@ -94,18 +88,16 @@ const DEFAULT_STYLES = {
"identifierEscapeTarget": "minimal",
"parameterSymbol": "?",
"parameterStyle": "anonymous",
"keywordCase": "lower",
"sourceAliasStyle": "implicit",
"sourceAliasStyle": "as",
"castStyle": "standard",
"constraintStyle": "mysql"
},
"SQLServer": {
...DEFAULT_STYLE_BASE,
"identifierEscape": "bracket",
"identifierEscapeTarget": "all",
"identifierEscapeTarget": "minimal",
"parameterSymbol": "@",
"parameterStyle": "named",
"keywordCase": "upper",
"sourceAliasStyle": "as",
"castStyle": "standard",
"constraintStyle": "postgres"
Expand All @@ -116,8 +108,7 @@ const DEFAULT_STYLES = {
"identifierEscapeTarget": "minimal",
"parameterSymbol": "@",
"parameterStyle": "named",
"keywordCase": "lower",
"sourceAliasStyle": "implicit",
"sourceAliasStyle": "as",
"castStyle": "standard",
"constraintStyle": "postgres"
}
Expand Down Expand Up @@ -149,7 +140,7 @@ function inferStyleDefaults(name, style) {
"insertColumnsOneLine": true,
"whenOneLine": false,
"oneLineMaxLength": 100,
"joinOnBreak": "none",
"joinOnBreak": "before",
"joinConditionContinuationIndent": false,
...dialectDefaults
};
Expand Down
23 changes: 21 additions & 2 deletions docs/public/migration-demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,35 @@ const defaultFormatOptions = {
"indentSize": 4,
"indentChar": "space",
"newline": "lf",
"keywordCase": "lower",
"keywordCase": "upper",
"commaBreak": "before",
"cteCommaBreak": "after",
"valuesCommaBreak": "before",
"andBreak": "before",
"orBreak": "before",
"joinOnBreak": "before",
"joinConditionContinuationIndent": false,
"identifierCase": "preserve",
"expressionWidth": 50,
"lineWrapping": false,
"exportComment": "full",
"commentStyle": "block",
"withClauseStyle": "standard",
"parenthesesOneLine": true,
"indentNestedParentheses": true,
"betweenOneLine": true,
"valuesOneLine": false,
"joinOneLine": true,
"caseOneLine": false,
"subqueryOneLine": false,
"sourceAliasStyle": "as",
"orderByDefaultDirectionStyle": "omit",
"castStyle": "standard",
"constraintStyle": "postgres",
"insertColumnsOneLine": true,
"whenOneLine": false
"whenOneLine": false,
"oneLineMaxLength": 100,
"joinConditionOrderByDeclaration": false
};

// Initialize Editors
Expand Down
Loading