SQLite 是否有 .NET/C# 包装器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/93654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 11:36:10  来源:igfitidea点击:

Is there a .NET/C# wrapper for SQLite?

提问by ian93

I'd sort of like to use SQLite from within C#.Net, but I can't seem to find an appropriate library. Is there one? An official one? Are there other ways to use SQLite than with a wrapper?

我有点想在 C#.Net 中使用 SQLite,但我似乎找不到合适的库。有吗?官方的?除了包装器,还有其他使用 SQLite 的方法吗?

采纳答案by ine

From https://system.data.sqlite.org:

来自https://system.data.sqlite.org

System.Data.SQLite is an ADO.NET adapter for SQLite.

System.Data.SQLite was started by Robert Simpson. Robert still has commit privileges on this repository but is no longer an active contributor. Development and maintenance work is now mostly performed by the SQLite Development Team. The SQLite team is committed to supporting System.Data.SQLite long-term.

System.Data.SQLite 是 SQLite 的 ADO.NET 适配器。

System.Data.SQLite 是由 Robert Simpson 创立的。Robert 仍然拥有此存储库的提交权限,但不再是活跃的贡献者。开发和维护工作现在主要由 SQLite 开发团队执行。SQLite 团队致力于长期支持 System.Data.SQLite。

"System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0 provider all rolled into a single mixed mode assembly. It is a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll). Unlike normal mixed assemblies, it has no linker dependency on the .NET runtime so it can be distributed independently of .NET."

“System.Data.SQLite 是原始的 SQLite 数据库引擎和完整的 ADO.NET 2.0 提供程序,所有这些都包含在一个单一的混合模式程序集中。它是原始 sqlite3.dll 的完整替代品(您甚至可以将其重命名为sqlite3.dll)。与普通的混合程序集不同,它对 .NET 运行时没有链接器依赖性,因此它可以独立于 .NET 进行分发。”

It even supports Mono.

它甚至支持 Mono。

回答by Tom Robinson

Here are the ones I can find:

以下是我能找到的:

Sources:

资料来源:

回答by tonyz

I'd definitely go with System.Data.SQLite(as previously mentioned: http://sqlite.phxsoftware.com/)

我肯定会选择System.Data.SQLite(如前所述:http: //sqlite.phxsoftware.com/

It is coherent with ADO.NET (System.Data.*), and is compiled into a single DLL. No sqlite3.dll - because the C code of SQLite is embedded within System.Data.SQLite.dll. A bit of managed C++ magic.

它与 ADO.NET (System.Data.*) 一致,并被编译为单个 DLL。没有 sqlite3.dll - 因为 SQLite 的 C 代码嵌入在 System.Data.SQLite.dll 中。有点托管 C++ 魔法。

回答by xanadont

There's also now this option: http://code.google.com/p/csharp-sqlite/- a complete port of SQLite to C#.

现在还有这个选项:http: //code.google.com/p/csharp-sqlite/- SQLite 到 C# 的完整端口。

回答by xanadont

Version 1.2 of Monotouch includes support for System.Data. You can find more details here: http://monotouch.net/Documentation/System.Data

Monotouch 1.2 版包括对 System.Data 的支持。您可以在此处找到更多详细信息:http: //monotouch.net/Documentation/System.Data

But basically it allows you to use the usual ADO .NET patterns with sqlite.

但基本上它允许您将通常的 ADO .NET 模式与 sqlite 一起使用。

回答by Antonio

http://www.devart.com/dotconnect/sqlite/

http://www.devart.com/dotconnect/sqlite/

dotConnect for SQLite is an enhanced data provider for SQLite that builds on ADO.NET technology to present a complete solution for developing SQLite-based database applications. As a part of the Devart database application development framework, dotConnect for SQLite offers both high performance native connectivity to the SQLite database and a number of innovative development tools and technologies.

dotConnect for SQLite 是 SQLite 的增强型数据提供程序,它基于 ADO.NET 技术构建,为开发基于 SQLite 的数据库应用程序提供完整的解决方案。作为 Devart 数据库应用程序开发框架的一部分,dotConnect for SQLite 提供与 SQLite 数据库的高性能本地连接以及许多创新的开发工具和技术。

dotConnect for SQLite introduces new approaches for designing application architecture, boosts productivity, and leverages database application implementation.

dotConnect for SQLite 引入了设计应用程序架构、提高生产力和利用数据库应用程序实现的新方法。

I use the standard version,it works perfect :)

我使用标准版本,它完美无缺:)

回答by David Schmitt

The folks from sqlite.org have taken over the development of the ADO.NET provider:

sqlite.org 的人已经接管了 ADO.NET 提供程序的开发:

From their homepage:

他们的主页

This is a fork of the popular ADO.NET 4.0 adaptor for SQLite known as System.Data.SQLite. The originator of System.Data.SQLite, Robert Simpson, is aware of this fork, has expressed his approval, and has commit privileges on the new Fossil repository. The SQLite development team intends to maintain System.Data.SQLite moving forward.

Historical versions, as well as the original support forums, may still be found at http://sqlite.phxsoftware.com, though there have been no updates to this version since April of 2010.

这是 SQLite 的流行 ADO.NET 4.0 适配器的分支,称为 System.Data.SQLite。System.Data.SQLite 的创始人 Robert Simpson 意识到了这个 fork,表示了他的认可,并且拥有对新 Fossil 存储库的提交权限。SQLite 开发团队打算继续维护 System.Data.SQLite。

历史版本以及原始支持论坛仍可在http://sqlite.phxsoftware.com上找到 ,尽管自 2010 年 4 月以来此版本没有更新。

The complete list of features can be found at on their wiki. Highlights include

完整的功能列表可以在他们的 wiki 上找到。亮点包括

  • ADO.NET 2.0 support
  • Full Entity Framework support
  • Full Mono support
  • Visual Studio 2005/2008 Design-Time support
  • Compact Framework, C/C++ support
  • ADO.NET 2.0 支持
  • 完整的实体框架支持
  • 完全单声道支持
  • Visual Studio 2005/2008 设计时支持
  • 紧凑的框架,C/C++ 支持

Released DLLs can be downloaded directly from the site.

已发布的 DLL 可以直接从该站点下载。

回答by Eminem

A barebones wrapper of the functions as provided by the sqlite library. Latest version supports functions provided sqlite library 3.7.10

sqlite 库提供的函数的准系统包装器。最新版本支持sqlite库3.7.10提供的功能

SQLiteWrapper project

SQLiteWrapper 项目

回答by Limited Atonement

Mono comes with a wrapper. https://github.com/mono/mono/tree/master/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0gives code to wrap the actual SQLite dll ( http://www.sqlite.org/sqlite-shell-win32-x86-3071300.zipfound on the download page http://www.sqlite.org/download.html/) in a .net friendly way. It works on Linux or Windows.

Mono 带有一个包装器。https://github.com/mono/mono/tree/master/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0提供了包装实际 SQLite dll(http://www.sqlite.dll )的代码。 org/sqlite-shell-win32-x86-3071300.zip在下载页面http://www.sqlite.org/download.html/上以 .net 友好的方式找到。它适用于 Linux 或 Windows。

This seems the thinnest of all worlds, minimizing your dependence on third party libraries. If I had to do this project from scratch, this is the way I would do it.

这似乎是所有世界中最薄的,最大限度地减少了对第三方库的依赖。如果我必须从头开始做这个项目,我会这样做。

回答by dodgy_coder

sqlite-netis an open source, minimal library to allow .NET and Mono applications to store data in SQLite 3 databases. More information at the wiki page.

sqlite-net是一个开源的最小库,允许 .NET 和 Mono 应用程序在SQLite 3 数据库中存储数据。维基页面上的更多信息。

It is written in C# and is meant to be simply compiled in with your projects. It was first designed to work with MonoTouch on the iPhone, but has grown up to work on all the platforms (Mono for Android, .NET, Silverlight, WP7, WinRT, Azure, etc.).

它是用 C# 编写的,旨在与您的项目一起编译。它最初设计用于在 iPhone 上与 MonoTouch 一起使用,但后来发展到可以在所有平台上使用(Mono for Android、.NET、Silverlight、WP7、WinRT、Azure 等)。

It is available as a Nuget package, where it is the 2nd most popular SQLite package with over 60,000 downloads as of 2014.

它以Nuget 包的形式提供,截至2014年,它是第二大最受欢迎的 SQLite 包,下载量超过 60,000。

sqlite-net was designed as a quick and convenient database layer. Its design follows from these goals:

sqlite-net 被设计为一个快速方便的数据库层。它的设计遵循以下目标:

  • Very easy to integrate with existing projects and with MonoTouch projects.
  • Thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.)
  • Very simple methods for executing CRUD operations and queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion.
  • Works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.)
  • 0 dependencies aside from a compiled form of the sqlite2 library.
  • 非常容易与现有项目和 MonoTouch 项目集成。
  • SQLite 上的瘦包装器,应该是快速和高效的。(库不应该成为查询的性能瓶颈。)
  • 用于安全地执行 CRUD 操作和查询(使用参数)以及以强类型方式检索这些查询结果的非常简单的方法。
  • 与您的数据模型一起使用,而无需强迫您更改类。(包含一个小的反射驱动的 ORM 层。)
  • 除了 sqlite2 库的编译形式之外,还有 0 个依赖项。

Non-goals include:

非目标包括:

  • Notan ADO.NET implementation. This is not a full SQLite driver. If you need that, use System.Data.SQLite.
  • 不是ADO.NET 实现。这不是一个完整的 SQLite 驱动程序。如果需要,请使用 System.Data.SQLite。