我有点喜欢从c#中使用SQLite。Net,但我似乎找不到合适的图书馆。有吗?官方的?除了使用包装器,还有其他方法使用SQLite吗?
当前回答
从https://system.data.sqlite.org:
System.Data.SQLite是ADO。SQLite的NET适配器。 sqlite是由Robert Simpson创建的。Robert仍然拥有此存储库上的提交特权,但不再是活动贡献者。开发和维护工作现在主要由SQLite开发团队执行。SQLite团队致力于长期支持System.Data.SQLite。
“System.Data。SQLite是原始的SQLite数据库引擎和一个完整的ADO。NET 2.0提供程序全部滚入一个混合模式程序集。它完全取代了原来的sqlite3.dll(您甚至可以将其重命名为sqlite3.dll)。与普通的混合程序集不同,它不依赖于。net运行时,因此可以独立于。net进行分发。”
它甚至支持Mono。
其他回答
SQLite -net是一个开源的最小库,允许. net和Mono应用程序在SQLite 3数据库中存储数据。更多信息请访问维基页面。
它是用c#编写的,可以简单地编译到项目中。它最初是为iPhone上的MonoTouch设计的,但已经发展到可以在所有平台上工作(Mono for Android, . net, Silverlight, WP7, WinRT, Azure等)。
它是一个Nuget包,在那里它是第二大最受欢迎的SQLite包,截至2014年超过6万次下载。
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.
非目标包括:
不是ADO。净的实现。这不是一个完整的SQLite驱动程序。如果需要,请使用System.Data.SQLite。
现在还有这个选项:http://code.google.com/p/csharp-sqlite/ -一个完整的SQLite到c#的移植。
对于那些像我一样不需要或不想要ADO的人。NET,那些需要运行更接近SQLite的代码,但仍然兼容netstandard (. NET framework, . NET core等)的人,我已经建立了一个100%免费的开源项目,名为SQLNado(“非ADO”),可在github:
https://github.com/smourier/SQLNado
它可以作为一个nuget在这里https://www.nuget.org/packages/SqlNado,但也可以作为一个单独的。cs文件,所以在任何c#项目类型中使用它都非常实用。
当使用SQL命令时,它支持所有SQLite特性,并且通过.NET也支持大多数SQLite特性:
Automatic class-to-table mapping (Save, Delete, Load, LoadAll, LoadByPrimaryKey, LoadByForeignKey, etc.) Automatic synchronization of schema (tables, columns) between classes and existing table Designed for thread-safe operations Where and OrderBy LINQ/IQueryable .NET expressions are supported (work is still in progress in this area), also with collation support SQLite database schema (tables, columns, etc.) exposed to .NET SQLite custom functions can be written in .NET SQLite incremental BLOB I/O is exposed as a .NET Stream to avoid high memory consumption SQLite collation support, including the possibility to add custom collations using .NET code SQLite extensions (.dll) loading support SQLite Full Text Search engine (FTS3) support, including the possibility to add custom FTS3 tokenizers using .NET code (like localized stop words for example). I don't believe any other .NET wrappers do that. Automatic support for Windows 'winsqlite3.dll' (only on recent Windows versions) to avoid shipping any binary dependency file. This works in Azure Web apps too!.
Microsoft.Data.Sqlite
微软现在提供Microsoft. data . SQLite作为。net的第一方SQLite解决方案,它是作为ASP. net的一部分提供的。净的核心。该许可证是Apache许可证,版本2.0。
NuGet包 在GitHub上的源回购
*免责声明:我自己还没有尝试过使用它,但是在微软文档中提供了一些关于。net Core和UWP使用它的文档。
从https://system.data.sqlite.org:
System.Data.SQLite是ADO。SQLite的NET适配器。 sqlite是由Robert Simpson创建的。Robert仍然拥有此存储库上的提交特权,但不再是活动贡献者。开发和维护工作现在主要由SQLite开发团队执行。SQLite团队致力于长期支持System.Data.SQLite。
“System.Data。SQLite是原始的SQLite数据库引擎和一个完整的ADO。NET 2.0提供程序全部滚入一个混合模式程序集。它完全取代了原来的sqlite3.dll(您甚至可以将其重命名为sqlite3.dll)。与普通的混合程序集不同,它不依赖于。net运行时,因此可以独立于。net进行分发。”
它甚至支持Mono。
推荐文章
- 在EF中更新父实体时如何添加/更新子实体
- ASP。NET身份的默认密码散列器-它是如何工作的,它是安全的?
- 如何从命令行在windows中找到mysql数据目录
- 如何写一个JSON文件在c# ?
- 如何找到MySQL的根密码
- 静态隐式运算符
- 不区分大小写列表搜索
- 'throw'和'throw new Exception()'的区别
- 不能在lambda表达式中使用ref或out参数
- c# int到字节[]
- 如何跟踪log4net问题
- 将WPF组合框绑定到自定义列表
- foreach vs somlist . foreach (){}
- 为什么try{…}最后{…}好;尝试{…} catch{}坏?
- c# 8用多种情况切换表达式,结果相同