HyperDev.Connectors.Sql
1.0.1
dotnet add package HyperDev.Connectors.Sql --version 1.0.1
NuGet\Install-Package HyperDev.Connectors.Sql -Version 1.0.1
<PackageReference Include="HyperDev.Connectors.Sql" Version="1.0.1" />
<PackageVersion Include="HyperDev.Connectors.Sql" Version="1.0.1" />
<PackageReference Include="HyperDev.Connectors.Sql" />
paket add HyperDev.Connectors.Sql --version 1.0.1
#r "nuget: HyperDev.Connectors.Sql, 1.0.1"
#:package HyperDev.Connectors.Sql@1.0.1
#addin nuget:?package=HyperDev.Connectors.Sql&version=1.0.1
#tool nuget:?package=HyperDev.Connectors.Sql&version=1.0.1
HyperDev.Connectors.Sql
SQL operations for HyperDev.Connectors: queries, stored procedures and functions through the HyperDev.Data
providers (SQL Server, Oracle, PostgreSQL, DB2 LUW and z/OS), with JSON input and output.
A query written by hand
var definition = new SqlOperationDefinition
{
Name = "customersOf",
Connection = "main", // a sql resource of the environment
CommandText = "SELECT Id, Name FROM Customers WHERE Province = @province",
Parameters = { new ParameterDefinition { Name = "province", Type = ParameterType.String, Required = true } }
};
JToken rows = await definition.Compile(environment).ExecuteAsync(new JObject { ["province"] = "RM" });
The result (result of the definition) is a list of rows, one row or a single value (SqlResultMode Rows, Row,
Scalar), or several result sets; maxRows with overflow (truncate or error) bounds the rows read, jsonColumns
and nestedColumns shape them.
Description from the database
SqlDescription description = SqlDescription.Create(environment, "main");
IReadOnlyList<DbQualifiedName> procedures = description.GetProcedures("dbo");
SqlProcedureDescription procedure = description.DescribeProcedure("dbo.FindCustomers");
SqlFunctionDescription function = description.DescribeFunction("dbo.CustomerScore");
SqlQueryDescription query = description.DescribeQuery("SELECT Id, Name FROM Customers WHERE Province = @province");
JsonSchema input = query.InputSchema;
SqlOperationDefinition fromQuery = query.CreateDefinition("customersOf", SqlResultMode.Rows);
Procedures and functions give their parameters (also table-valued and output parameters, cursors, return value)
and result sets; a query is described without running it, by the provider (IDbCommandDescriber). The connectors
have no logic of a database: catalog and descriptions are services of the HyperDev.Data providers registered by the
host.
The resource
{
"sql": {
"main": {
"provider": "Microsoft.Data.SqlClient",
"connectionString": "Server=db.example.com;Database=Sales;TrustServerCertificate=true",
"userName": "app",
"password": "${env:DB_PASSWORD}",
"schemas": { "map": { "SALES": "SALES_TEST" } }
}
}
}
userName and password are added to the connection string by the provider; defaultSchema is used when reading
the catalog; schemas.map replaces, when an operation is compiled, a schema (or schema.name) written in the
commands with the one of this environment, so the same definition runs where the schemas have other names.
Values of {{$var.name}} reach the command only as parameters, never inside the SQL text. Errors of the database are
OperationException with a stable Reason (backend.unauthorized, backend.deadlock, backend.unavailable,
fault.service…) and the error number in Code.
Target frameworks: net8.0, net10.0. Depends on HyperDev.Data.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 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. |
-
net10.0
- HyperDev.Connectors (>= 1.0.0)
- HyperDev.Data (>= 1.2.7)
-
net8.0
- HyperDev.Connectors (>= 1.0.0)
- HyperDev.Data (>= 1.2.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on HyperDev.Connectors.Sql:
| Package | Downloads |
|---|---|
|
HyperDev.Connectors.Editor
HyperDev Fatum Framework: server side of the connector editor (@wemake4u/connector-editor) |
GitHub repositories
This package is not used by any popular GitHub repositories.