Syntax Element: type
Description
Identifies a specific type, including precision, scale, length, and nullness.
Example
This keyword is highlighted
like this.
You can click on keywords and concepts in blue.
database SomeDatabase { types int as integer, number ("numeric") as real, nstring ("nvarchar") as string; version 1.0 : initialized { design { public table T { // integer not null public column C1 with DataType = type(int); // integer null public column C2 with DataType = type(int null); // nvarchar(20) not null public column C3 with DataType = type(nstring(20)); //nvarchar(100) null public column C4 with DataType = type(nstring(100) null); // numeric(10, 3) not null public column C5 with DataType = type(number(10, 3)); // numeric(12, 4) public column C6 with DataType = type(number(12, 4) null); } } } }
Notes
- Rarely do you want to map something like a T-SQL INT to anything other than an integer type in your client. To avoid re-specifying such mappings, every type is derived from a base type defined using the types keyword.
Related Use Cases
- Specifying design separately from construction
- Getting compiler feedback on your database design
- Eliminating duplication between client and database code
- Deriving creation scripts from design
- Keeping clients coupled to the current version
- Leveraging a version's proxy in a client
- Transition testing
Other Actions
documentation | all examples for this syntax element | all examples | use cases | concepts | keywords
database