urQL/docs/ref-ch06-alter.md

79 lines
1.6 KiB
Markdown
Raw Normal View History

2022-10-31 05:52:27 +03:00
# ALTER INDEX
2022-08-10 23:23:12 +03:00
```
ALTER INDEX [ <db-qualifer> ]{ <index-name> }
ON { <table-name> | <view-name> }
[ ( <column-name> [ ASC | DESC ] [ ,...n ] ) ]
2022-08-10 23:23:12 +03:00
{ REBUILD | DISABLE | RESUME}
```
2022-08-06 17:06:18 +03:00
Discussion:
2022-08-10 21:45:17 +03:00
`RESUME` will rebuild the index if the underlying object is dirty.
2022-08-06 17:06:18 +03:00
2022-10-31 05:52:27 +03:00
# ALTER NAMESPACE
2022-08-10 23:23:12 +03:00
```
ALTER NAMESPACE [ <database-name>. ]<namespace-name>
TRANSFER { TABLE | VIEW } [ <db-qualifer> ]{ <table-name> | <view-name> }
```
2022-08-10 21:45:17 +03:00
Discussion:
2022-10-31 05:52:27 +03:00
The namespace *sys* cannot be altered, nor can objects be transferred in or out of it.
2022-08-06 17:06:18 +03:00
2022-10-31 05:52:27 +03:00
# ALTER PROCEDURE
2022-08-06 17:06:18 +03:00
```
ALTER { PROC | PROCEDURE }
[<db-qualifer>]<procedure-name>
[ { #<parameter-name> <data-type> } ] [ ,...n ]
2022-10-31 05:52:27 +03:00
AS { <urql command>; | *hoon } [ ;...n ]
```
Discussion:
TBD
2022-10-31 05:52:27 +03:00
# ALTER TABLE
2022-08-10 23:23:12 +03:00
```
ALTER TABLE [ <db-qualifer> ]{ <table-name> }
2022-09-10 20:02:00 +03:00
{ ALTER COLUMN ( { <column-name> <aura> } [ ,... n ] )
| ADD COLUMN ( { <column-name> <aura> } [ ,... n ] )
| DROP COLUMN ( { <column-name> } [ ,... n ] )
2022-08-10 23:23:12 +03:00
| ADD FOREIGN KEY <foreign-key-name> (<column-name> [ ,... n ])
2022-10-31 05:52:27 +03:00
REFERENCES [<namespace-name>.]<table-name> (<column-name> [ ,... n ])
[ ON DELETE { NO ACTION | CASCADE } ]
[ ON UPDATE { NO ACTION | CASCADE } ]
2022-08-10 23:23:12 +03:00
[ ,... n ]
2022-09-10 20:02:00 +03:00
| DROP FOREIGN KEY ( <foreign-key-name> [ ,... n ] } )
2022-08-10 23:23:12 +03:00
```
2022-08-06 17:06:18 +03:00
Example:
2022-08-10 23:23:12 +03:00
```
ALTER TABLE my-table
DROP FOREIGN KEY fk-1, fk-2
```
2022-08-06 17:06:18 +03:00
2022-10-31 05:52:27 +03:00
# ALTER TRIGGER
2022-08-06 17:06:18 +03:00
2022-08-10 23:23:12 +03:00
```
ALTER TRIGGER { [ <db-qualifer> ]{ <trigger-name> } | ALL ]
ON { SERVER | <database.name> | <table-name> | <view-name> }
[ ENABLE | DISABLE ]
```
2022-08-06 17:06:18 +03:00
2022-08-10 21:45:17 +03:00
Discussion:
2022-10-31 05:52:27 +03:00
TBD
2022-08-10 21:45:17 +03:00
2022-08-06 17:06:18 +03:00
2022-10-31 05:52:27 +03:00
# ALTER VIEW
2022-08-06 17:06:18 +03:00
2022-08-10 23:23:12 +03:00
```
ALTER VIEW [ <db-qualifer> ]{ <view-name> }
( { [<alias>.] <column-name> } [ ,...n ] )
AS <select_statement>
```