Examples
In documentation for syntax element current
You can click on keywords and concepts in blue.
database X { version 1.0 : initialized { } // this is the current version current version 2.0 : 1.0 { } // this version is in-work version 2.1 : 2.0 { } }
In documentation for syntax element namespace
You can click on keywords and concepts in blue.
namespace My.Name.Space { // Generates as My.Name.Space.Foo from client perspective database Foo { } }
In documentation for syntax element integer
You can click on keywords and concepts in blue.
types int as integer;
In documentation for syntax element real
You can click on keywords and concepts in blue.
types number as real; //... column SomeColumn with DataType = type(number(10, 2));
In documentation for syntax element datetime
You can click on keywords and concepts in blue.
types dt as datetime; //... column SomeColumn with DataType = type(dt);
In documentation for syntax element string
You can click on keywords and concepts in blue.
types nstring ("nvarchar") as string, fixstring ("char") as string, guid ("uniqueidentifier") as string; //... column ID with DataType = type(guid); column Column1 with DataType = type(nstring(200)); column USState with DataType = type(fixstring(2));
In documentation for syntax element as
You can click on keywords and concepts in blue.
types int as integer;
In documentation for syntax element binding
You can click on keywords and concepts in blue.
design { view Foo ("tblFoo") with X = 5; } construction { step sql { SELECT TOP $[Foo.X] * FROM $[Foo] } }
In documentation for syntax element hash
You can click on keywords and concepts in blue.
database TheDB { version 1.0 { hash 1091851333; } }
In documentation for syntax element types
You can click on keywords and concepts in blue.
database SomeDatabase { types // logical name 'int', database name 'int', integer client type int as integer, // logical name 'number', database name 'numeric', real number client type number ("numeric") as real, // logical name 'nstring', database type 'nvarchar', string client type nstring ("nvarchar") as string; version 1.0 : initialized { design { public table T { public column C1 with DataType = type(int); public column C2 with DataType = type(int null); public column C3 with DataType = type(nstring(20)); public column C4 with DataType = type(nstring(100) null); public column C5 with DataType = type(number(10, 3)); public column C6 with DataType = type(number(12, 4) null); } } } }
In documentation for syntax element type
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); } } } }
In documentation for syntax element database
You can click on keywords and concepts in blue.
// declares a database classdatabase MyDatabase { // database versions } /* Database declarations are inherently partial that is, you can have more than one declaration for the same database class and they are merged together. This declaration defines version 1.0 as the first version fully controlled with DataClass. */ database DatabaseSplitAcrossMultipleFiles { version 1.0 : initialized // ... } /* This declaration defines another version (1.1) version 1.1 succeeds version 1.0. */ database DatabaseSplitAcrossMultipleFiles { version 1.1 : 1.0 // ... }
In documentation for syntax element version
You can click on keywords and concepts in blue.
// defining the initialized versiondatabase MyDatabase { version initialized { } } // defining a new version for your database database MyDatabase { version 1.0 : initialized { } }
In documentation for syntax element :
You can click on keywords and concepts in blue.
// causes version 1.1 to inherit from version 1.0version 1.1 : 1.0 // causes Y to inherit from X public table X ("dat_X"); public table Y : X;
In documentation for syntax element design
You can click on keywords and concepts in blue.
// begins declaring the design for a versiondatabase YourDatabase { // ... version initialized { design { public table ALegacyTable; } } }
In documentation for syntax element open curly
You can click on keywords and concepts in blue.
// beginning a design blockdesign { // ... // beginning a construction block construction { // ... // beginning a database database { // ...
In documentation for syntax element close curly
You can click on keywords and concepts in blue.
// beginning a design blockdesign { // ... } // beginning a construction block construction { // ... } // beginning a database database { // ... }
In documentation for syntax element construction
You can click on keywords and concepts in blue.
database IndustrialDB { version 2.1 : 2.0 { construction { // steps to build a database up to the containing version } } }
In documentation for syntax element step sql
You can click on keywords and concepts in blue.
database Links { version initialized { construction { step sql { -- SQL step to initialize a database } } } version 1.0 : initialized { construction { step sql { -- a SQL step to advance from initialized to 1.0 } step sql { -- the second step to get from initialized to 1.0 } } } }
In documentation for syntax element initialized
You can click on keywords and concepts in blue.
database MyLegacyDatabase { version initialized { // ... attributes of a pre-DataClass database } }
In documentation for syntax element version number
You can click on keywords and concepts in blue.
database DatabaseWithSomeHistory { version 1.0 : initialized { } version 2.0 : 1.0 { } version 2.0.1 : 2.0 { } version 2.0.1.4 : 2.0.1 { } }
In documentation for syntax element stereotypes
You can click on keywords and concepts in blue.
database { stereotypes table, column; }
In documentation for syntax element with
You can click on keywords and concepts in blue.
database DB { version 1.0 : initialized { types int as integer; stereotypes table, column; design { public table X ("dat_X") { public column MyColumn with public DataType = type(int), public SortOrder = "ASC"; } } } }
In documentation for syntax element with validation
You can click on keywords and concepts in blue.
database MyDatabase { stereotypes column with validation = minimal, table with validation = none; }
In documentation for syntax element minimal
You can click on keywords and concepts in blue.
database MyDatabase { stereotypes column with validation = minimal, table with validation = none; }
In documentation for syntax element table
You can click on keywords and concepts in blue.
database HasATable { stereotypes table with validation = minimal; version 1.0 : initialized { design { public table X; } } }
In documentation for syntax element column
You can click on keywords and concepts in blue.
database HasATable { types int as integer, varstring ("nvarchar") as string, number ("numeric") as real; stereotype table with validation = minimal; version 1.0 : initialized { design { protected table X { public column A with DataType = type(int); public column B with DataType = type(varstring(5)); public column C with DataType = type(number(5,2)); } } } }
In documentation for syntax element procedure
You can click on keywords and concepts in blue.
database HasAProcedure { stereotype procedure with validation = minimal; version 1.0 : initialized { design { public procedure AddKey ("keys_Add"); public procedure RemoveKey ("keys_Remove"); } } }
In documentation for syntax element removed
You can click on keywords and concepts in blue.
public table Foo { public column Bar; } public table Foo2 : Foo { // Foo2.Bar should not be a valid target of any coupling removed Bar; }
In documentation for syntax element null
You can click on keywords and concepts in blue.
// this integer should be nullabletype(int null);
In documentation for syntax element parameter
You can click on keywords and concepts in blue.
database HasAProcedure { stereotype procedure with validation = minimal, parameter with validation = minimal; version 1.0 : initialized { design { public procedure AddKey ("keys_Add") { public parameter Input ("@V"); } } } }
In documentation for syntax element result
You can click on keywords and concepts in blue.
database HasAProcedure { stereotype procedure with validation = minimal, parameter with validation = minimal, result with validation = minimal; version 1.0 : initialized { design { public procedure AddKey ("keys_Add") { public parameter Input ("@V"); public result Values { public column A; } } } } }
In documentation for syntax element none
You can click on keywords and concepts in blue.
database MyDatabase { stereotypes column with validation = minimal, table with validation = none; }
In documentation for syntax element public
You can click on keywords and concepts in blue.
database MyDatabase { stereotypes column, table; version 1.0 : initialized { protected table X { public column A; public column B; protected other TransitionSpecificStuff with InterestingFact1 = 5, InterestingFact2 = "ten"; } } }
In documentation for syntax element protected
You can click on keywords and concepts in blue.
database MyDatabase { stereotypes column, table, other; version 1.0 : initialized { protected table X { public column A; public column B; protected other TransitionSpecificStuff with InterestingFact1 = 5, InterestingFact2 = "ten"; } } }
In documentation for syntax element in context
You can click on keywords and concepts in blue.
database SomeDB { stereotypes X, Y, Z; version 1.0 : initialized { design { protected X something { public Y somethingElse; public Y somethingDifferent; protected Z with protected a = 1, protected b = "two"; } } construction { in context X.Z { step sql { INSERT INTO $[X]($[X.somethingElse], $[X.somethingDifferent]) VALUES($[a], $[b]); } } } } }
In documentation for syntax element physical name
You can click on keywords and concepts in blue.
database HasPhysicalNames { types longString ("text") as string; stereotypes table; version initialized { design { public table FollowsConvention ("tbl_FollowsAConvention"); } } }
Other Actions
documentation | all examples | use cases | concepts | keywords
database