You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Marek Fišera edited this page Nov 28, 2015
·
14 revisions
Neptuo.Data.Sql is concept for simple and thin SQL data layer. Here are some thoughts on design. Implementation is currently far away.
Tables are described by TableColumns classes. These classes contains table, joined and computed columns.
Columns
Columns are key to everything. The base contract for column is:
publicinterfaceIColumn{TypeValueType{get;}}
and the generic version for specifying generic return type (for reading values, described later):
publicinterfaceIColumn<T>:IColumn{}
For these column contracts there are implementations for defining table owned column, left and inner joins, computed columns and etc.
Primary keys will be also marked own implementation of the IColumn. Inserts will defuse columns of this type, but updates will require those.
Joins
Having columns organized in TableColumns allows for great reuse in terms of joins. Define class with columns and create instance of it in the another TableColumns class to define join on the first table.