-
-
Notifications
You must be signed in to change notification settings - Fork 131
Getting Started
- Visual Studio 2015 Community or higher
- NuGet Package Command Line installed in your PATH via NuGet.org or via Chocolatey.
- (Optional) RazorGenerator to modify CodeGen templates.
git clone https://github.com/bchavez/RethinkDb.Driver.gitcd RethinkDb.Driver
The following build tasks are defined in BauBuild.cs. Execute any of the following build commands in the root project folder.
-
build- By default, triggersbuild msb. -
build msb- Builds binaries for .NET Framework v4.5 using msbuild. -
build dnx- Builds CoreCLR binaries using dnu build. -
build mono- Builds Mono binaries using xbuild. -
build clean- Cleans up build. -
build astgen- Regenerates C# AST classes from*.jsonfiles. -
build pack- Builds local NuGet packages. -
build yamlimport- Imports and cleans up freshly copied YAML tests from the Java driver. See Unit Tests section below. -
build testgen- Generates C# unit tests from refined YAML tests.
The following folders at the root checkout level be generated:
-
__compile- Contains the result of the build process. -
__package- Contains the result of the packaging process.
-
build.cmd- Ensures sane build environment and forwards build commands toBuilder. -
Source\Builder- Primary location where build tasks are defined. SeeBauBuild.cs. -
Source\RethinkDb.Driver- The RethinkDB C# driver. -
Source\RethinkDb.Driver.Tests- Driver unit tests. -
Source\Templates- Code generation templates.
There are two main components of this C# driver. The ReQL Abstract Syntax Tree (AST) and the infrastructure to handle serialization/deserialization of the AST. The infrastructure also handles communication with a RethinkDB server.
The ReQL AST is located in Source\RethinkDb.Driver\Generated\Ast. The AST C# classes are generated using code generation templates in Source\Templates. The code generation process is similar to the Java driver, except this C# driver
requires JSON metadata files derived the Java driver's
python scripts (namely, metajava.py). The JSON metadata files required to rebuild the AST (and other objects) are:
proto_basic.jsonglobal_info.jsonjava_term_info.json
These files reside inside Source/Templates/Metadata.
java_term_info.json is a special file (not to be confused with term_info.json).
java_term_info.json is a more refined output of term_info.json that includes extra metadata to support OOP language semantics when generating RethinkDB's AST. java_term_info.json generated
by running the following command in the Java driver's folder:
python3 metajava.py --term-info term_info.json --output-file java_term_info.json generate-java-terminfo
The result of the command above will produce java_term_info.json. The JSON files inside the Java driver's folder can be copied to & overwritten inside the C# driver's folder Source/Templates/Metadata. The build astgen task will use the *.json files mentioned above to regenerate all AST C# classes, protocol enums, and various models.
build astgen build task essentially runs Templates\GeneratorForAst.cs:Generate_All().
The code generator templates are located in Source/Templates/CodeGen/.
The templates are RazorGenerator templates. Updating any of the *.cshtml code generation
templates requires installing RazorGenerator's Visual Studio Extension
or using RazorGenerator's MSBuild task to transform the Razor *.cshtml templates to *.generated.cs razor code-behind files.
- Home
- Query Examples
- Logging
- Connections & Pooling
- Extra C# Features
- GOTCHA Goblins!
- LINQ to ReQL Provider
- Differences
- Java ReQL API Documentation