Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Tidb | 33,670 | 68 | 101 | 10 hours ago | 1,289 | April 07, 2022 | 3,895 | apache-2.0 | Go | |
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial | ||||||||||
Metabase | 31,849 | 21 hours ago | 1 | June 08, 2022 | 2,790 | other | Clojure | |||
The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum: | ||||||||||
Dbeaver | 31,225 | 9 hours ago | 1,748 | apache-2.0 | Java | |||||
Free universal database tool and SQL client | ||||||||||
Cockroach | 26,824 | 50 | 22 | 11 hours ago | 248 | August 06, 2021 | 6,533 | other | Go | |
CockroachDB - the open source, cloud-native distributed SQL database. | ||||||||||
Sqlmap | 26,518 | 3 days ago | 1 | February 27, 2018 | 59 | other | Python | |||
Automatic SQL injection and database takeover tool | ||||||||||
Tdengine | 21,065 | 1 | 14 hours ago | 12 | April 14, 2022 | 873 | agpl-3.0 | C | ||
TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, Industrial IoT and DevOps. | ||||||||||
Directus | 20,738 | 50 | 16 hours ago | 55 | September 22, 2022 | 358 | gpl-3.0 | TypeScript | ||
The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database. | ||||||||||
Postgrest | 20,255 | 4 | 17 hours ago | 37 | July 12, 2022 | 200 | mit | Haskell | ||
REST API for any Postgres database | ||||||||||
Surrealdb | 19,073 | 10 hours ago | 35 | December 14, 2021 | 177 | other | Rust | |||
A scalable, distributed, collaborative, document-graph database, for the realtime web | ||||||||||
Shardingsphere | 18,155 | 8 | 13 hours ago | 7 | June 04, 2020 | 572 | apache-2.0 | Java | ||
Ecosystem to transform any database into a distributed database system, and enhance it with sharding, elastic scaling, encryption features & more |
Lightweight high-performance data access components for generating SQL commands, mapping results to strongly typed POCO models or dictionaries, schema-less CRUD-operations with RecordSet.
NuGet | Windows x64 | Ubuntu |
---|---|---|
Class | Dependencies | Purpose |
---|---|---|
DbFactory |
incapsulates DB-specific functions and conventions | |
DbCommandBuilder |
IDbFactory | composes IDbCommand and SQL text for SELECT/UPDATE/DELETE/INSERT, handles app-level dataviews |
DbDataAdapter |
IDbCommandBuilder, IDbConnection | CRUD operations for model, dictionary, DataTable or RecordSet: Insert/Update/Delete/Select. Async versions are supported for all methods. |
Query |
Represents abstract query to database; used as parameter in DbCommandBuilder, DbDataAdapter | |
RelexParser |
Parsers query string expression (Relex) into Query structure | |
RecordSet |
RecordSet model represents in-memory data records, this is lightweight and efficient replacement for classic DataTable/DataRow | |
DataReaderResult |
IDataReader | reads data from any data reader implementation and efficiently maps it to models, dictionaries, DataTable or RecordSet |
NReco.Data documentation:
Generic implementation of DbFactory
can be used with any ADO.NET connector.
DbFactory initialization for SqlClient:
var dbFactory = new DbFactory(System.Data.SqlClient.SqlClientFactory.Instance) {
LastInsertIdSelectText = "SELECT @@IDENTITY" };
DbFactory initialization for Mysql:
var dbFactory = new DbFactory(MySql.Data.MySqlClient.MySqlClientFactory.Instance) {
LastInsertIdSelectText = "SELECT LAST_INSERT_ID()" };
DbFactory initialization for Postgresql:
var dbFactory = new DbFactory(Npgsql.NpgsqlFactory.Instance) {
LastInsertIdSelectText = "SELECT lastval()" };
DbFactory initialization for Sqlite:
var dbFactory = new DbFactory(Microsoft.Data.Sqlite.SqliteFactory.Instance) {
LastInsertIdSelectText = "SELECT last_insert_rowid()" };
DbCommandBuilder generates SQL commands by Query:
var dbCmdBuilder = new DbCommandBuilder(dbFactory);
var selectCmd = dbCmdBuilder.GetSelectCommand(
new Query("Employees", (QField)"BirthDate" > new QConst(new DateTime(1960,1,1)) ) );
var selectGroupByCmd = dbCmdBuilder.GetSelectCommand(
new Query("Employees").Select("company_id", new QAggregateField("avg_age", "AVG", "age") ) );
var insertCmd = dbCmdBuilder.GetInsertCommand(
"Employees", new { Name = "John Smith", BirthDate = new DateTime(1980,1,1) } );
var deleteCmd = dbCmdBuilder.GetDeleteCommand(
new Query("Employees", (QField)"Name" == (QConst)"John Smith" ) );
DbDataAdapter - provides simple API for CRUD-operations:
var dbConnection = dbFactory.CreateConnection();
dbConnection.ConnectionString = "<db_connection_string>";
var dbAdapter = new DbDataAdapter(dbConnection, dbCmdBuilder);
// map select results to POCO models
var employeeModelsList = dbAdapter.Select( new Query("Employees") ).ToList<Employee>();
// read select result to dictionary
var employeeDictionary = dbAdapter.Select(
new Query("Employees", (QField)"EmployeeID"==(QConst)newEmployee.EmployeeID ).Select("FirstName","LastName")
).ToDictionary();
// update by dictionary
dbAdapter.Update(
new Query("Employees", (QField)"EmployeeID"==(QConst)1001 ),
new Dictionary<string,object>() {
{"FirstName", "Bruce" },
{"LastName", "Wayne" }
});
// insert by model
dbAdapter.Insert( "Employees", new { FirstName = "John", LastName = "Smith" } );
RecordSet - efficient replacement for DataTable/DataRow with very similar API:
var rs = dbAdapter.Select(new Query("Employees")).ToRecordSet();
rs.SetPrimaryKey("EmployeeID");
foreach (var row in rs) {
Console.WriteLine("ID={0}", row["EmployeeID"]);
if ("Canada".Equals(row["Country"]))
row.Delete();
}
dbAdapter.Update(rs);
var rsReader = new RecordSetReader(rs); // DbDataReader for in-memory rows
Relex - compact relational query expressions:
var relex = @"Employees(BirthDate>""1960-01-01"":datetime)[Name,BirthDate]"
var relexParser = new NReco.Data.Relex.RelexParser();
Query q = relexParser.Parse(relex);
DbFactory
and add wrapper for DbCommand
that logs SQL commands produced by DbDataAdapter
NReco.Data is in production use at SeekTable.com and PivotData microservice.
Copyright 2016-2023 Vitaliy Fedorchenko and contributors
Distributed under the MIT license