import Since from '@components/shared/Since.astro' import RailroadDiagram from '@components/RailroadDiagram.astro' import Tabs from '@components/Tabs/Tabs.astro' import TabItem from '@components/Tabs/TabItem.astro'
ALTER CONFIG statement
The ALTER CONFIG statement can be used to modify an existing defined config.
Statement syntax
SurrealQL Syntax
ALTER CONFIG [ IF EXISTS ]
( API
[ MIDDLEWARE @function(...), ... ]
PERMISSIONS [ NONE | FULL | @expression ]
| GRAPHQL
TABLES [ AUTO | NONE | INCLUDE @table, ... | EXCLUDE @table, ... ]
FUNCTIONS [ AUTO | NONE | INCLUDE @function, ... | EXCLUDE @function, ... ]
[ DEPTH @integer ]
[ COMPLEXITY @integer ]
[ INTROSPECTION NONE ]
| DEFAULT
NAMESPACE @namespace
DATABASE @database
)
[ COMMENT @string | DROP COMMENT ]
export const alterAst = { type: "Diagram", padding: [10, 20, 10, 20], children: [ { type: "Sequence", children: [ { type: "Terminal", text: "ALTER CONFIG" }, { type: "Optional", child: { type: "Sequence", children: [ { type: "Terminal", text: "IF" }, { type: "Terminal", text: "EXISTS" }, ], }, }, { type: "Choice", index: 0, children: [ { type: "Sequence", children: [ { type: "Terminal", text: "API" }, { type: "Optional", child: { type: "Sequence", children: [ { type: "Terminal", text: "MIDDLEWARE" }, { type: "NonTerminal", text: "@function(...)" }, { type: "ZeroOrMore", child: { type: "Sequence", children: [ { type: "Terminal", text: "," }, { type: "NonTerminal", text: "@function(...)" }, ], }, repeat: { type: "Skip" }, }, ], }, }, { type: "Terminal", text: "PERMISSIONS" }, { type: "Choice", index: 0, children: [ { type: "Terminal", text: "NONE" }, { type: "Terminal", text: "FULL" }, { type: "NonTerminal", text: "@expression" }, ], }, ], }, { type: "Sequence", children: [ { type: "Terminal", text: "GRAPHQL" }, { type: "Terminal", text: "TABLES" }, { type: "Choice", index: 0, children: [ { type: "Terminal", text: "AUTO" }, { type: "Terminal", text: "NONE" }, { type: "Sequence", children: [ { type: "Terminal", text: "INCLUDE" }, { type: "NonTerminal", text: "@table" }, { type: "ZeroOrMore", child: { type: "Sequence", children: [ { type: "Terminal", text: "," }, { type: "NonTerminal", text: "@table" }, ], }, repeat: { type: "Skip" }, }, ], }, { type: "Sequence", children: [ { type: "Terminal", text: "EXCLUDE" }, { type: "NonTerminal", text: "@table" }, { type: "ZeroOrMore", child: { type: "Sequence", children: [ { type: "Terminal", text: "," }, { type: "NonTerminal", text: "@table" }, ], }, repeat: { type: "Skip" }, }, ], }, ], }, { type: "Terminal", text: "FUNCTIONS" }, { type: "Choice", index: 0, children: [ { type: "Terminal", text: "AUTO" }, { type: "Terminal", text: "NONE" }, { type: "Sequence", children: [ { type: "Terminal", text: "INCLUDE" }, { type: "NonTerminal", text: "@function" }, { type: "ZeroOrMore", child: { type: "Sequence", children: [ { type: "Terminal", text: "," }, { type: "NonTerminal", text: "@function" }, ], }, repeat: { type: "Skip" }, }, ], }, { type: "Sequence", children: [ { type: "Terminal", text: "EXCLUDE" }, { type: "NonTerminal", text: "@function" }, { type: "ZeroOrMore", child: { type: "Sequence", children: [ { type: "Terminal", text: "," }, { type: "NonTerminal", text: "@function" }, ], }, repeat: { type: "Skip" }, }, ], }, ], }, { type: "Optional", child: { type: "Sequence", children: [ { type: "Terminal", text: "DEPTH" }, { type: "NonTerminal", text: "@integer" }, ], }, }, { type: "Optional", child: { type: "Sequence", children: [ { type: "Terminal", text: "COMPLEXITY" }, { type: "NonTerminal", text: "@integer" }, ], }, }, { type: "Optional", child: { type: "Sequence", children: [ { type: "Terminal", text: "INTROSPECTION" }, { type: "Terminal", text: "NONE" }, ], }, }, ], }, { type: "Sequence", children: [ { type: "Terminal", text: "DEFAULT" }, { type: "Terminal", text: "NAMESPACE" }, { type: "NonTerminal", text: "@namespace" }, { type: "Terminal", text: "DATABASE" }, { type: "NonTerminal", text: "@database" }, ], }, ], }, { type: "Optional", child: { type: "Choice", index: 0, children: [ { type: "Sequence", children: [ { type: "Terminal", text: "COMMENT" }, { type: "Terminal", text: "@string" }, ], }, { type: "Sequence", children: [ { type: "Terminal", text: "DROP" }, { type: "Terminal", text: "COMMENT" }, ], }, ], }, }, ], }, ], };
Example usage
DEFINE CONFIG GRAPHQL TABLES AUTO FUNCTIONS AUTO;
ALTER CONFIG GRAPHQL FUNCTIONS NONE;