简体   繁体   English

首次加载SQLite数据库的设计注意事项

[英]Design considerations for loading an SQLite Database for the first time

I am creating a system that will store objects in an SQLite Database. 我正在创建一个将对象存储在SQLite数据库中的系统。 I am using C# with System.Data.SQLite. 我将C#与System.Data.SQLite一起使用。

This is a "best practise" kind of question - is it better, when loading a Database, to: 这是一个“最佳实践”类型的问题-加载数据库时是否更好:

a) Create the SQLite database programatically if it doesn't exist a)如果不存在,则以编程方式创建SQLite数据库

or 要么

b) Connect to a pre-created database using an SQLite database creation tool b)使用SQLite数据库创建工具连接到预先创建的数据库

I'd go for a mix: 我会混合的:

a) Create the SQLite database programatically if it doesn't exist a)如果不存在,则以编程方式创建SQLite数据库

and optionally: 以及可选的:

b) Connect to a pre-created database using an SQLite database creation tool b)使用SQLite数据库创建工具连接到预先创建的数据库

Because If You implement A, switching to scenario B would be as simple as copying a file during installation. 因为如果实施A,切换到方案B就像在安装过程中复制文件一样简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM