-
Notifications
You must be signed in to change notification settings - Fork 12
Database Objects
A database system is structured in objects that define specific properties and can be uniquely identified, retrieved and modified within the system.
Database objects can be queried using specific SELECT
statements towards generated tables that provide the properties of the objects (eg. SELECT * FROM system.triggers
will select all the triggers present in the system).
NOTE: In Version DeveelDB 2.0, the object Index is not included, although it most likely is an object and follows in the previous definition: this is a limitation to the current query model. Starting from Version 2.3 it will be included
In DeveelDB a database defines one or more schema, that is a container for other database objects. The main purpose of a schema is to define a unique namespace for contained objects, and to transmit common configurations to the objects that it contains.
Anyway, not all the objects can be defined at schema-level: these kind of objects can be defined inside a schema:
- Tables
- Views
- Sequences
- Stored Triggers
- Routines
- User-Defined Types
Sequences are progression of numbers that follow a defined configuration to generate the next element of the sequence.
DeveelDB generates a sequence for each table that is created in the system: this kind of sequence cannot be modified externally, but it is possible to obtain its value, using the same statements and functions to obtain the values of any other sequence.
Native sequences are used by the system to obtain the latest and unique identifier for a column in a table: this value (the row number) is one of the components of the ROWID
that uniquely identifies a row within a database.
Internally, DeveelDB uses a very low-level sequence to assign the unique identifiers of tables (the table-id): this is the other component of a ROWID
.
A native sequence has the same exact name of the table it refers to: for instance, if the user creates a table APP.test_table
, the system will create a native sequence named APP.test_table
, that can be accessed as a sequence.
The most common type of sequence is the one that a user can create using the CREATE SEQUENCE
statement. Users can define sequences with arbitrary parameters to control its behavior:
- An initial number of the sequence
- The maximum number reachable by the sequence before stop
- The minimum number of the sequence (in case of recursion)
- Whether or not the sequence must cycle, once reached the maxim number
- Whether or not the sequence should cache the last value
The table is main container of data in a database: it is structured in columns and rows and the conjunction of the two results in a single field that is used to store data of a defined type.
As such, a table is also an object container (like a Schema) and contains objects of type Column and Row.
- Getting Started
- Basic Principles
- Operative Contexts
- Transactions
- Database Objects
- Data Types
- SQL Execution Plan
- SQL Model
- DeveelDB SQL Dialect
- Data Types
- Routines (Functions and Procedures)
- Collaborate
- Kernel Development
- External Contributions
- Bug Reporting
- Documentation