Data.Modeler 4.0.238

There is a newer version of this package available.
See the version list below for details.
dotnet add package Data.Modeler --version 4.0.238
                    
NuGet\Install-Package Data.Modeler -Version 4.0.238
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Data.Modeler" Version="4.0.238" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Data.Modeler" Version="4.0.238" />
                    
Directory.Packages.props
<PackageReference Include="Data.Modeler" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Data.Modeler --version 4.0.238
                    
#r "nuget: Data.Modeler, 4.0.238"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Data.Modeler@4.0.238
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Data.Modeler&version=4.0.238
                    
Install as a Cake Addin
#tool nuget:?package=Data.Modeler&version=4.0.238
                    
Install as a Cake Tool

Data.Modeler

Build status

Data.Modeler is a library used to interact with model database schemas in C#. Works with .Net Core.

Basic Usage

In order to use Data.Modeler, you need to first wire up the system with your ServiceCollection. In order to do this, all you need to do is make one method call:

serviceCollection.AddCanisterModules();
				

This line is required prior to using the DataModeler class for the first time. Once Canister is set up, you can call the DataModeler class provided:

var SchemaProvider = DataModeler.GetSchemaGenerator(SqlClientFactory.Instance);

Note that the above gets the schema provider for SQL Server but for other databases you must provide the DbProviderFactory associated with it. You can also start creating a schema:

var Source = DataModeler.CreateSource("MySource");

The "MySource" string is the database name that you wish to use.

Creating a Schema

Once you have your ISource object, you can start adding on to it:

var Table = Source.AddTable("TableName", "dbo");
var Column = Table.AddColumn<int>("ColumnName",DbType.Int32);
var CheckConstraint = Table.AddCheckConstraint("CheckConstraintName", "Check Constraint Definition");
var View = Source.AddView("ViewName","View Creation Code", "dbo");
var Function = Source.AddFunction("FunctionName","Function Creation Code", "dbo");
var StoredProcedure = Source.AddStoredProcedure("StoredProcedureName","Stored Procedure Creation Code", "dbo");

From there the schema provider can be used to either generate the commands needed to create the database or what commands are needed to alter an existing database to the desired schema:

var MyCommands = SchemaProvider.GenerateSchema(DesiredSchema, SourceSchema);

If SourceSchema is null, then it will treat it as the database doesn't exist. If the SourceSchema is not null, it will act as though the database exists and the DesiredSchema is what you want the final schema to look like. Note that deleting columns, tables, etc. is not done by the system. It will, however, generate calls to drop functions, stored procedures, views, constraints, etc. if they need to be updated. Another thing you can do is have the system apply those changes for you:

SchemaProvider.Setup(DesiredSchema,new Connection(Configuration, SqlClientFactory.Instance, "Default"));

The connection object must be fed a IConfiguration object, a DbProviderFactory for the database type you wish it to connect to, and either the name of your connection string in the configuration object or a connection string:

SchemaProvider.Setup(DesiredSchema,new Connection(Configuration, SqlClientFactory.Instance, "Data Source=localhost;Initial Catalog=ExampleDatabase;Integrated Security=SSPI;Pooling=false"));

Adding a ISchemaGenerator

The schema generator is what the system uses to generate the individual commands. Data.Modeler comes with one for SQL Server but in order to add your own you must create a class that inherits from ISchemaGenerator. From there the system will automatically pick up the schema generator and allow you to use it:

var SchemaProvider = DataModeler.GetSchemaGenerator(MyDbFactoryProvider);

Note that you can also create one for SQL Server and the system will actually return the one that you create instead of the one built into the system.

Installation

The library is available via Nuget with the package name "Data.Modeler". To install it run the following command in the Package Manager Console:

Install-Package Data.Modeler

Build Process

In order to build the library you will require the following as a minimum:

  1. Visual Studio 2022

Other than that, just clone the project and you should be able to load the solution and build without too much effort.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Data.Modeler:

Package Downloads
Inflatable

Inflatable is a simple ORM.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.72 248 9/18/2025
5.0.71 236 9/18/2025
5.0.70 260 9/17/2025
5.0.69 266 9/16/2025
5.0.68 166 9/11/2025
5.0.67 146 9/10/2025
5.0.66 157 9/9/2025
5.0.65 297 8/20/2025
5.0.64 136 8/20/2025
5.0.63 143 8/20/2025
5.0.62 133 8/19/2025
5.0.61 137 8/19/2025
5.0.60 164 8/19/2025
5.0.59 130 8/15/2025
5.0.58 292 8/6/2025
5.0.57 242 8/5/2025
5.0.56 220 8/5/2025
5.0.55 223 8/5/2025
5.0.54 252 8/5/2025
5.0.53 195 8/5/2025
5.0.52 70 8/1/2025
5.0.51 133 7/28/2025
5.0.50 185 7/17/2025
5.0.49 150 7/17/2025
5.0.48 219 7/15/2025
5.0.47 156 7/14/2025
5.0.46 157 7/14/2025
5.0.45 198 7/8/2025
5.0.44 512 6/30/2025
5.0.43 153 6/30/2025
5.0.42 152 6/30/2025
5.0.41 158 6/27/2025
5.0.40 197 6/27/2025
5.0.39 146 6/27/2025
5.0.38 153 6/27/2025
5.0.37 149 6/27/2025
5.0.36 195 6/26/2025
5.0.35 173 6/18/2025
5.0.34 324 6/10/2025
5.0.33 121 5/30/2025
5.0.32 127 5/23/2025
5.0.31 262 5/14/2025
5.0.30 137 5/2/2025
5.0.29 192 4/28/2025
5.0.28 154 4/11/2025
5.0.27 188 3/17/2025
5.0.26 160 2/24/2025
5.0.25 178 2/12/2025
5.0.24 288 2/3/2025
5.0.23 199 1/30/2025
5.0.22 168 1/29/2025
5.0.21 137 1/29/2025
5.0.20 154 1/28/2025
5.0.19 156 1/24/2025
5.0.18 156 1/23/2025
5.0.17 135 1/23/2025
5.0.16 181 1/16/2025
5.0.15 152 1/15/2025
5.0.14 143 1/14/2025
5.0.13 139 1/13/2025
5.0.12 153 1/10/2025
5.0.11 150 1/9/2025
5.0.10 129 1/8/2025
5.0.9 206 12/17/2024
5.0.8 156 12/17/2024
5.0.7 193 12/10/2024
5.0.6 152 12/9/2024
5.0.5 226 11/26/2024
5.0.4 184 11/26/2024
5.0.3 142 11/25/2024
5.0.2 179 11/24/2024
5.0.1 157 11/23/2024
5.0.0 148 11/23/2024
4.0.268 170 11/19/2024
4.0.267 146 11/11/2024
4.0.266 142 11/6/2024
4.0.265 136 11/5/2024
4.0.264 137 11/4/2024
4.0.263 163 11/1/2024
4.0.262 142 10/31/2024
4.0.261 148 10/30/2024
4.0.260 145 10/29/2024
4.0.259 146 10/29/2024
4.0.258 157 10/25/2024
4.0.257 136 10/24/2024
4.0.256 158 10/21/2024
4.0.255 155 10/16/2024
4.0.254 143 10/15/2024
4.0.253 152 10/11/2024
4.0.252 142 10/10/2024
4.0.251 142 10/9/2024
4.0.250 150 10/8/2024
4.0.249 158 10/2/2024
4.0.248 158 10/1/2024
4.0.247 145 9/30/2024
4.0.246 162 9/27/2024
4.0.245 150 9/24/2024
4.0.244 161 9/23/2024
4.0.243 142 9/23/2024
4.0.242 190 9/17/2024
4.0.241 184 9/10/2024
4.0.240 155 9/9/2024
4.0.239 158 9/6/2024
4.0.238 169 9/5/2024
4.0.237 166 9/3/2024
4.0.236 160 9/2/2024
4.0.235 162 8/30/2024
4.0.234 166 8/29/2024
4.0.233 172 8/28/2024
4.0.232 164 8/27/2024
4.0.231 162 8/26/2024
4.0.230 180 8/23/2024
4.0.229 176 8/22/2024
4.0.228 177 8/21/2024
4.0.227 177 8/20/2024
4.0.226 174 8/20/2024
4.0.225 199 8/19/2024
4.0.224 195 8/16/2024
4.0.223 177 8/15/2024
4.0.222 199 8/14/2024
4.0.221 153 8/5/2024
4.0.220 146 8/2/2024
4.0.219 174 8/1/2024
4.0.218 139 7/31/2024
4.0.217 166 7/26/2024
4.0.216 144 7/25/2024
4.0.215 111 7/24/2024
4.0.214 164 7/11/2024
4.0.213 151 7/10/2024
4.0.212 145 7/9/2024
4.0.211 152 7/9/2024
4.0.210 154 7/8/2024
4.0.209 168 7/5/2024
4.0.208 172 7/5/2024
4.0.207 153 7/2/2024
4.0.206 146 7/1/2024
4.0.205 176 6/27/2024
4.0.204 172 6/26/2024
4.0.203 166 6/25/2024
4.0.202 179 6/24/2024
4.0.201 1,048 6/19/2024
4.0.200 179 6/18/2024
4.0.199 149 6/17/2024
4.0.198 156 6/14/2024
4.0.197 150 6/13/2024
4.0.196 162 6/12/2024
4.0.195 170 6/3/2024
4.0.194 156 5/31/2024
4.0.193 187 5/30/2024
4.0.192 159 5/29/2024
4.0.191 178 5/27/2024
4.0.190 160 5/27/2024
4.0.189 150 5/23/2024
4.0.188 161 5/22/2024
4.0.187 195 5/21/2024
4.0.186 176 5/20/2024
4.0.185 175 5/17/2024
4.0.184 169 5/16/2024
4.0.183 175 5/15/2024
4.0.182 172 5/8/2024
4.0.181 160 5/7/2024
4.0.180 178 5/6/2024
4.0.179 181 5/3/2024
4.0.178 733 5/2/2024
4.0.177 139 5/1/2024
4.0.176 169 4/30/2024
4.0.175 159 4/29/2024
4.0.174 161 4/29/2024
4.0.173 180 4/25/2024
4.0.172 177 4/24/2024
4.0.171 184 4/16/2024
4.0.170 171 4/15/2024
4.0.169 171 4/12/2024
4.0.168 165 4/12/2024
4.0.167 188 4/11/2024
4.0.166 197 4/10/2024
4.0.165 172 4/9/2024
4.0.164 176 4/8/2024
4.0.163 174 4/1/2024
4.0.162 155 3/29/2024
4.0.161 178 3/28/2024
4.0.160 159 3/26/2024
4.0.159 184 3/23/2024
4.0.158 182 3/22/2024
4.0.157 182 3/21/2024
4.0.156 161 3/18/2024
4.0.155 188 3/15/2024
4.0.154 177 3/14/2024
4.0.153 182 3/13/2024
4.0.152 205 3/11/2024
4.0.151 183 3/8/2024
4.0.150 180 3/7/2024
4.0.149 170 3/6/2024
4.0.148 177 3/5/2024
4.0.147 997 3/4/2024
4.0.146 195 3/1/2024
4.0.145 198 2/29/2024
4.0.144 195 2/28/2024
4.0.143 199 2/27/2024
4.0.142 196 2/26/2024
4.0.141 205 2/23/2024
4.0.140 202 2/22/2024
4.0.139 181 2/21/2024
4.0.138 204 2/20/2024
4.0.137 444 2/19/2024
4.0.136 165 2/19/2024
4.0.135 166 2/16/2024
4.0.134 177 2/16/2024
4.0.133 169 2/15/2024
4.0.132 175 2/14/2024
4.0.131 165 2/13/2024
4.0.130 194 2/12/2024
4.0.129 169 2/9/2024
4.0.128 218 2/8/2024
4.0.127 176 2/7/2024
4.0.126 193 2/6/2024
4.0.125 149 2/6/2024
4.0.124 162 2/5/2024
4.0.123 534 2/2/2024
4.0.122 188 2/1/2024
4.0.121 161 2/1/2024
4.0.120 193 1/31/2024
4.0.119 250 1/30/2024
4.0.118 189 1/29/2024
4.0.117 202 1/26/2024
4.0.116 182 1/24/2024
4.0.115 159 1/23/2024
4.0.114 168 1/22/2024
4.0.113 371 1/16/2024
4.0.112 215 1/15/2024
4.0.111 185 1/15/2024
4.0.110 183 1/12/2024
4.0.109 171 1/11/2024
4.0.108 171 1/10/2024
4.0.107 362 1/8/2024
4.0.106 239 1/5/2024
4.0.105 357 12/26/2023
4.0.104 202 12/26/2023
4.0.103 215 12/25/2023
4.0.102 195 12/25/2023
4.0.101 273 12/22/2023
4.0.100 218 12/21/2023
4.0.99 230 12/15/2023
4.0.98 197 12/14/2023
4.0.97 182 12/13/2023
4.0.96 206 12/13/2023
4.0.95 356 12/12/2023
4.0.94 201 12/12/2023
4.0.93 193 12/11/2023
4.0.92 186 12/11/2023
4.0.91 242 12/6/2023
4.0.90 179 12/6/2023
4.0.89 178 12/5/2023
4.0.88 227 12/4/2023
4.0.87 234 11/24/2023
4.0.86 186 11/23/2023
4.0.85 190 11/21/2023
4.0.84 193 11/20/2023
4.0.83 186 11/20/2023
4.0.82 228 11/17/2023
4.0.81 673 11/16/2023
4.0.80 196 11/15/2023
4.0.79 195 11/13/2023
4.0.78 205 11/9/2023
4.0.77 210 11/8/2023
4.0.76 161 11/8/2023
4.0.75 188 11/7/2023
4.0.74 198 11/6/2023
4.0.73 191 11/3/2023
4.0.72 237 11/2/2023
4.0.71 178 11/1/2023
4.0.70 180 11/1/2023
4.0.69 224 10/31/2023
4.0.68 208 10/30/2023
4.0.67 201 10/27/2023
4.0.66 218 10/26/2023
4.0.65 219 10/25/2023
4.0.64 208 10/17/2023
4.0.63 170 10/17/2023
4.0.62 227 10/16/2023
4.0.61 234 10/13/2023
4.0.60 257 10/12/2023
4.0.59 194 10/11/2023
4.0.58 229 10/5/2023
4.0.57 209 10/4/2023
4.0.56 200 9/26/2023
4.0.55 202 9/25/2023
4.0.54 226 9/22/2023
4.0.53 225 9/20/2023
4.0.52 218 9/19/2023
4.0.51 209 9/18/2023
4.0.50 201 9/18/2023
4.0.49 252 9/14/2023
4.0.48 230 9/13/2023
4.0.47 194 9/12/2023
4.0.46 280 9/11/2023
4.0.45 197 9/11/2023
4.0.44 185 9/11/2023
4.0.43 317 9/7/2023
4.0.42 201 9/6/2023
4.0.41 265 9/5/2023
4.0.40 209 9/4/2023
4.0.39 223 9/4/2023
4.0.38 260 9/1/2023
4.0.37 267 8/31/2023
4.0.36 253 8/30/2023
4.0.35 270 8/29/2023
4.0.34 212 8/29/2023
4.0.33 295 8/28/2023
4.0.32 272 8/25/2023
4.0.31 255 8/24/2023
4.0.30 237 8/23/2023
4.0.29 253 8/22/2023
4.0.28 250 8/18/2023
4.0.27 263 8/17/2023
4.0.26 235 8/17/2023
4.0.25 224 8/16/2023
4.0.24 323 8/10/2023
4.0.23 273 8/9/2023
4.0.22 282 8/8/2023
4.0.21 245 8/8/2023
4.0.20 357 8/7/2023
4.0.19 251 8/4/2023
4.0.18 311 8/3/2023
4.0.17 285 8/2/2023
4.0.16 290 7/26/2023
4.0.15 265 7/25/2023
4.0.14 287 7/20/2023
4.0.13 282 7/19/2023
4.0.12 268 7/18/2023
4.0.11 214 7/18/2023
4.0.10 269 7/18/2023
4.0.9 225 7/18/2023
4.0.8 343 7/17/2023
4.0.7 241 7/17/2023
4.0.6 622 1/30/2023
4.0.5 480 1/30/2023
4.0.4 478 1/27/2023
4.0.3 590 12/13/2022
4.0.0 387 12/12/2022
3.0.47 1,604 6/10/2022
3.0.45 1,079 4/20/2022
3.0.44 1,100 1/11/2022
3.0.43 719 1/10/2022
3.0.42 1,187 6/17/2021
3.0.41 844 6/16/2021
3.0.40 813 6/16/2021
3.0.39 600 6/16/2021
3.0.38 1,117 1/7/2021
3.0.37 931 12/16/2020
3.0.36 857 12/14/2020
3.0.35 2,413 9/13/2020
3.0.34 987 6/19/2020
3.0.33 1,978 5/12/2020
3.0.32 1,500 5/12/2020
3.0.31 985 4/28/2020
3.0.30 939 4/24/2020
3.0.29 936 4/16/2020
3.0.28 995 4/16/2020
3.0.27 669 4/15/2020
3.0.26 963 4/15/2020
3.0.25 1,021 4/14/2020
3.0.24 716 4/14/2020
3.0.23 1,058 4/10/2020
3.0.22 1,002 4/10/2020
3.0.21 1,038 4/7/2020
3.0.20 2,857 3/26/2020
3.0.19 1,022 3/26/2020
3.0.18 699 3/25/2020
3.0.17 696 3/25/2020
3.0.16 711 3/25/2020
3.0.15 716 3/25/2020
3.0.13 718 3/25/2020
3.0.12 713 3/25/2020
3.0.11 682 3/25/2020
3.0.10 1,248 3/25/2020
3.0.9 1,069 3/22/2020
3.0.8 677 3/22/2020
3.0.7 1,067 3/21/2020
3.0.6 1,695 3/13/2020
3.0.5 737 3/13/2020
3.0.4 1,446 2/28/2020
3.0.3 1,290 2/21/2020
3.0.2 745 2/11/2020
3.0.1 719 2/11/2020
3.0.0 1,890 12/23/2019
2.0.13 750 11/4/2019
2.0.12 824 6/19/2019
2.0.11 794 6/19/2019
2.0.10 1,100 4/17/2019
2.0.9 1,654 2/21/2019
2.0.8 4,107 8/1/2018
2.0.7 1,448 8/1/2018
2.0.6 1,965 6/26/2018
2.0.5 1,329 6/14/2018
2.0.4 1,920 6/1/2018
2.0.3 1,879 5/22/2018
2.0.2 2,472 5/11/2018
2.0.1 2,547 2/13/2018
2.0.0 2,449 1/2/2018
1.0.29 4,059 11/16/2017
1.0.28 1,172 11/16/2017
1.0.27 6,571 10/18/2017
1.0.26 4,777 9/22/2017
1.0.24 1,237 9/22/2017
1.0.23 1,581 9/22/2017
1.0.22 1,244 9/22/2017
1.0.21 1,264 9/22/2017
1.0.19 1,269 9/22/2017
1.0.18 1,258 9/21/2017
1.0.17 2,296 8/4/2017
1.0.16 1,272 7/3/2017
1.0.15 1,282 6/16/2017
1.0.13 1,276 6/16/2017
1.0.12 1,260 6/16/2017
1.0.11 1,280 5/30/2017
1.0.9 1,271 5/25/2017
1.0.8 1,255 5/24/2017
1.0.7 1,280 5/19/2017
1.0.6 1,318 5/17/2017
1.0.4 1,378 4/3/2017
1.0.3 1,396 3/22/2017
1.0.2 1,386 2/2/2017