Oracle Schema
data
The data block defines seed/lookup data for a table.
data {
table = table.countries
rows = [
{ code = "US", name = "United States" },
{ code = "CA", name = "Canada" },
]
}
data attributes
| Name | Required | Value |
|---|---|---|
rows | true | Any value |
table | true | Object reference to |
function
The function block describes a function in a database schema.
function "positive" {
schema = schema.public
lang = SQL
arg "v" {
type = integer
}
...
}
function attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
deterministic | false | bool |
return | true | Function return type can be one of:
|
schema | true | Object reference to |
function blocks
function.arg
function.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | true | Function argument type can be one of:
|
function.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function.arg "name" ) | true |
| Repeatable | true |
function constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function "name" ) | true |
Allow Qualifier (e.g., function "schema" "name" ) | true |
index_type
index_type attributes
| Name | Required | Value |
|---|---|---|
impl_type | true | Object reference to |
local_partition | false | bool |
schema | true | Object reference to |
system_managed | false | bool |
index_type blocks
index_type.operator
index_type.operator attributes
| Name | Required | Value |
|---|---|---|
operator | true | Object reference to |
param_types | false | Any value |
index_type.operator constraints
| Constraint | Value |
|---|---|
| Required | true |
| Require Name | false |
| Repeatable | true |
index_type constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., index_type "name" ) | true |
Allow Qualifier (e.g., index_type "schema" "name" ) | true |
nested_table
nested_table attributes
| Name | Required | Value |
|---|---|---|
schema | true | Object reference to |
type | true | Element type can be one of:
|
nested_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., nested_table "name" ) | true |
Allow Qualifier (e.g., nested_table "schema" "name" ) | true |
object_type
object_type attributes
| Name | Required | Value |
|---|---|---|
final | false | bool |
schema | true | Object reference to |
under | false | Object reference to |
object_type blocks
object_type.attribute
object_type.attribute attributes
| Name | Required | Value |
|---|---|---|
type | true | Attribute type can be one of:
|
object_type.attribute constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.attribute "name" ) | true |
object_type.constructor
object_type.constructor attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
object_type.constructor blocks
object_type.constructor.arg
object_type.constructor.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | false | Argument type can be one of:
|
object_type.constructor.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.constructor.arg "name" ) | true |
object_type.constructor.self
object_type.constructor.self attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
object_type.function
object_type.function attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
final | false | bool |
overriding | false | bool |
return | false | Return type can be one of:
|
static | false | bool |
object_type.function blocks
object_type.function.arg
object_type.function.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | false | Argument type can be one of:
|
object_type.function.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.function.arg "name" ) | true |
object_type.function.self
object_type.function.self attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
object_type.function constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.function "name" ) | true |
| Repeatable | true |
object_type.map
object_type.map attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
final | false | bool |
overriding | false | bool |
return | false | Return type can be one of:
|
object_type.map blocks
object_type.map.arg
object_type.map.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | false | Argument type can be one of:
|
object_type.map.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.map.arg "name" ) | true |
object_type.map.self
object_type.map.self attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
object_type.map constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.map "name" ) | true |
object_type.order
object_type.order attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
final | false | bool |
overriding | false | bool |
return | false | Return type can be one of:
|
object_type.order blocks
object_type.order.arg
object_type.order.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | false | Argument type can be one of:
|
object_type.order.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.order.arg "name" ) | true |
object_type.order.self
object_type.order.self attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
object_type.order constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.order "name" ) | true |
object_type.procedure
object_type.procedure attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
final | false | bool |
overriding | false | bool |
static | false | bool |
object_type.procedure blocks
object_type.procedure.arg
object_type.procedure.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | false | Argument type can be one of:
|
object_type.procedure.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.procedure.arg "name" ) | true |
object_type.procedure.self
object_type.procedure.self attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
object_type.procedure constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type.procedure "name" ) | true |
| Repeatable | true |
object_type constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., object_type "name" ) | true |
Allow Qualifier (e.g., object_type "schema" "name" ) | true |
| Mutually exclusive sets | [map, order] |
operator
operator attributes
| Name | Required | Value |
|---|---|---|
schema | true | Object reference to |
operator blocks
operator.binding
operator.binding attributes
| Name | Required | Value |
|---|---|---|
args | false | Any value |
compute_ancillary | false | bool |
function | true | Binding function can be one of:
|
impl_type | false | Object reference to |
return | true | Return type can be one of:
|
with_index_context | false | bool |
operator.binding constraints
| Constraint | Value |
|---|---|
| Required | true |
| Require Name | false |
| Repeatable | true |
operator constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., operator "name" ) | true |
Allow Qualifier (e.g., operator "schema" "name" ) | true |
procedure
The procedure block describes a procedure in a database schema.
procedure "proc" {
schema = schema.public
lang = SQL
arg "a" {
type = integer
}
...
}
procedure attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
schema | true | Object reference to |
procedure blocks
procedure.arg
procedure.arg attributes
| Name | Required | Value |
|---|---|---|
mode | false |
|
nocopy | false | bool |
type | true | Procedure argument type can be one of:
|
procedure.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure.arg "name" ) | true |
| Repeatable | true |
procedure constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure "name" ) | true |
Allow Qualifier (e.g., procedure "schema" "name" ) | true |
schema
The schema block describes a database schema.
schema "public" {
...
}
schema attributes
| Name | Required | Value |
|---|---|---|
name | false | string |
schema constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., schema "name" ) | true |
table
The table block describes a table in a database schema.
table "users" {
schema = schema.public
column "id" {
type = int
}
...
}
table attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
table blocks
table.check
table.check attributes
| Name | Required | Value |
|---|---|---|
expr | true | string |
table.check constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.column
table.column attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
table.column blocks
table.column.identity
table.column.identity attributes
| Name | Required | Value |
|---|---|---|
cache | false | int |
cycle | false | bool |
generated | false |
|
increment | false | int |
max_value | false | int |
min_value | false | int |
order | false | bool |
start | false | int |
table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.column "name" ) | true |
| Mutually exclusive sets | [as (attribute), as (block)] |
table.foreign_key
table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
on_delete | false |
|
ref_columns | true | Foreign key reference columns can be one of:
|
table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.foreign_key "name" ) | true |
table.index
table.index attributes
| Name | Required | Value |
|---|---|---|
bitmap | false | bool |
columns | false | Index columns can be one of:
|
domain | false | Domain index type can be one of:
|
parameters | false | string |
reversed | false | bool |
unique | false | bool |
table.index blocks
table.index.on
table.index.on attributes
| Name | Required | Value |
|---|---|---|
column | false | Index columns can be one of:
|
desc | false | bool |
expr | false | string |
table.index.on constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
| Mutually exclusive sets | [column, expr] |
table.index constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.index "name" ) | true |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
table.primary_key
table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | false | Primary key columns can be one of:
|
comment | false | string |
include | false | Primary key included columns can be one of:
|
table.primary_key blocks
table.primary_key.on
table.primary_key.on attributes
| Name | Required | Value |
|---|---|---|
column | true | Primary key columns can be one of:
|
desc | false | bool |
table.primary_key.on constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.primary_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.primary_key "name" ) | true |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
table.unique
table.unique attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
table.unique constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.unique "name" ) | true |
table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table "name" ) | true |
Allow Qualifier (e.g., table "schema" "name" ) | true |
trigger
The trigger block describes a trigger on a table in a database schema.
trigger "trigger_orders_audit" {
on = table.orders
...
}
trigger attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
call | false | string |
follows | false | Object reference to |
for | false |
|
foreach | false |
|
on | true | Trigger on can be one of: |
precedes | false | Object reference to |
when | false | string |
trigger blocks
trigger.after
trigger.after attributes
| Name | Required | Value |
|---|---|---|
delete | false | bool |
insert | false | bool |
truncate | false | bool |
update | false | bool |
update_of | false | Trigger update_of columns can be one of:
|
trigger.after constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [update, update_of] |
| One of required sets | [insert, delete, truncate, update, update_of] |
trigger.before
trigger.before attributes
| Name | Required | Value |
|---|---|---|
delete | false | bool |
insert | false | bool |
truncate | false | bool |
update | false | bool |
update_of | false | Trigger update_of columns can be one of:
|
trigger.before constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [update, update_of] |
| One of required sets | [insert, delete, truncate, update, update_of] |
trigger.instead_of
trigger.instead_of attributes
| Name | Required | Value |
|---|---|---|
delete | false | bool |
insert | false | bool |
truncate | false | bool |
update | false | bool |
update_of | false | Trigger update_of columns can be one of:
|
trigger.instead_of constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [update, update_of] |
| One of required sets | [insert, delete, truncate, update, update_of] |
trigger.referencing
trigger.referencing attributes
| Name | Required | Value |
|---|---|---|
new | false | string |
old | false | string |
parent | false | string |
trigger.referencing constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
trigger constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., trigger "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [foreach, for], [follows, precedes], [before, after, instead_of], [as, call] |
| One of required sets | [before, after, instead_of], [as, call] |
varray
varray attributes
| Name | Required | Value |
|---|---|---|
limit | true | int |
schema | true | Object reference to |
type | true | Element type can be one of:
|
varray constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., varray "name" ) | true |
Allow Qualifier (e.g., varray "schema" "name" ) | true |
view
The view block describes a view in a database schema.
view "clean_users" {
schema = schema.public
column "id" {
type = int
}
...
}
view attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
view blocks
view.column
view.column attributes
| Name | Required | Value |
|---|---|---|
null | false | bool |
type | true | Column type can be one of:
|
view.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., view.column "name" ) | true |
view constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., view "name" ) | true |
Allow Qualifier (e.g., view "schema" "name" ) | true |