SurrealDb.Net.Design 0.2.0

dotnet add package SurrealDb.Net.Design --version 0.2.0
                    
NuGet\Install-Package SurrealDb.Net.Design -Version 0.2.0
                    
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="SurrealDb.Net.Design" Version="0.2.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SurrealDb.Net.Design" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SurrealDb.Net.Design">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 SurrealDb.Net.Design --version 0.2.0
                    
#r "nuget: SurrealDb.Net.Design, 0.2.0"
                    
#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 SurrealDb.Net.Design@0.2.0
                    
#: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=SurrealDb.Net.Design&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SurrealDb.Net.Design&version=0.2.0
                    
Install as a Cake Tool

SurrealDb.Net.Design

SurrealDb.Net.Design is the Visual Studio Package Manager Console package for scaffolding C# record models from a SurrealDB database schema.

Use this package when you want design-time commands inside Visual Studio's Package Manager Console. For command prompt, shell, CI, or dotnet tool usage, install the companion SurrealDb.Net.Design.Tool package instead.

Usage

Scaffold-SurrealDbDatabase `
  -Connection "Server=ws://localhost:8000/rpc;Namespace=app;Database=app;Username=root;Password=secret" `
  -Output Models `
  -ModelNamespace MyApp.Models `
  -Overwrite

Scaffold-SurrealDbContext is available as an alias for the same command. The optional -Project parameter runs the command from a specific project's directory so relative output paths land in that project.

The command connects to SurrealDB, inspects table and field metadata, and generates editable partial C# model classes plus an optional query context.

Command Options

-Connection <value>        SurrealDB connection string. Defaults to $SURREALDB_CONNECTION_STRING.
-Endpoint <url>            Override connection string server. Defaults to http://localhost:8000.
-Namespace <name>          Override connection string namespace. Defaults to $SURREALDB_NS or main.
-Database <name>           Override connection string database. Defaults to $SURREALDB_DB or main.
-User <name>               Override connection string username. Defaults to $SURREALDB_USER.
-Password <value>          Override connection string password. Defaults to $SURREALDB_PASS.
-Token <value>             Override connection string bearer token. Defaults to $SURREALDB_TOKEN.
-Output <path>             Output directory. Defaults to Generated.
-ModelNamespace <name>     Namespace for generated classes. Defaults to SurrealDb.Generated.
-Context <name>            Name for the generated query context. Defaults to <Database>DbContext.
-ContextNamespace <name>   Namespace for the generated query context. Defaults to -ModelNamespace.
-NoContext                 Do not generate a query context.
-RecordBaseType <type>     Base type for generated records. Defaults to IRecord.
-RecordNamespace <name>    Namespace imported for the record base type. Defaults to SurrealDb.Net.Models.
-Table <name>              Restrict generation to one table. Can be repeated or comma-separated.
-File <path>               Read schema from a local .surql file instead of SurrealDB. Can be repeated.
-Overwrite                 Replace existing generated files.

Local SURQL files

Pass one or more .surql schema files with -File to scaffold C# partial model classes without connecting to SurrealDB:

Scaffold-SurrealDbDatabase -File schema.surql -Output Models -ModelNamespace MyApp.Models -Overwrite

The reader uses DEFINE TABLE and DEFINE FIELD ... ON TABLE ... TYPE ... definitions, including flexible tables.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 115 8/13/2026
0.1.1 156 6/29/2026