当前位置:网站首页>Flutter教程之sqlite_wrapper新的 Dart 和 Flutter 库,用于 SQLite
Flutter教程之sqlite_wrapper新的 Dart 和 Flutter 库,用于 SQLite
2022-07-21 18:39:00 【知识大胖】
Dart和Flutter提供了多种存储数据的方式,但最好的解决方案之一仍然是像 SQLite 这样的传统数据库。
许多库已经存在以或多或少抽象的方式处理 SQLite,但如果您精通 SQL,并且只希望在您和您的数据之间有一个最小层,那么sqlite_wrapper可能是您的解决方案。
这些是启发创建sqlite_wrapper的基本原则:
- 没有样板
- 没有生成代码
- 反应式 API
- 一个更简单的 API 来转换和建模对象
- 完全访问 SQL 语言功能而无需学习新的技巧
- 完全测试的代码
- 多平台(目前在 iOS、Android、macOS、Windows 上测试)—Web is not supported
- 没有(极端)魔法,而是一个漂亮而简单的 API
- 最小依赖(只是Simon Binder的sqlite3包),所以它甚至可以从dart中使用
- 该 API 是准系统,具有合理的默认值,允许直接使用而无需花费太多时间来学习它。
该库可从pub.dev 获得,所有带有完整多平台示例的源代码都可以在github上查看。
SQLiteWrapper是一个单例,因此无需实例化它并将其存储在变量中,只需调用其构造函数,每次都返回相同的实例。
让我们看一个与规范ToDo应用程序一起使用的库的简单示例。
第一个操作是打开数据库:
openDB方法支持在创建
边栏推荐
- 将瑞吉外卖项目jar包部署在远程服务器并成功运行在pc和移动端
- 第三章第四节:形参
- Rollup系Layer2战局:发行Token 争夺市场
- How win10 sends icons to the desktop
- Intelligent science innovation lecture hall | Institute of automation he Huiguang: Research on deep learning brain mechanism based on visual information encoding and decoding
- Wechat applet rich text plugin parser
- 传统企业的办公模式正在发生着变化,为什么企业需要数字化办公?
- VSCODE解决终端中文乱码的问题
- 黑马瑞吉外卖之过滤器后台登录验证(详细笔记说明)
- N分钟学会分位值的计算方式
猜你喜欢
Don't be ridiculous. Don't you know what abilities to improve if you want to enter a big factory? (collect quickly)
直播预告│智汇云舟“数字孪生智慧园区解决方案”专场
关于for...in和for...of理解和使用
tsconfig. JSON cannot find any input in the configuration file. What should I do?
世界上最大的开源基金会 Apache 是如何运作的?
第二章 第二十五节:文件操作:with和复制
第二章第二十节:运算符.1
CocosCreator手游多屏幕适配
day02
在线XML转CSV工具
随机推荐
第二章第十八节:字符集和编码
The office mode of traditional enterprises is changing. Why do enterprises need digital office?
《机器人SLAM导航核心技术与实战》第1季:第1章_ROS入门必备知识
Section 26 of Chapter II: document operation: document modification
数据队列操作,串口透传缓冲实例
In the cold winter of the Internet, how can we advance from functional testing to automated testing in three months? [attached learning guide]
测试/开发程序员为什么会有职业瓶颈?好像所有的情况都发生了变化......
Unity C#:使用this关键字对类函数进行拓展
初识 JS
华泰证券远程开户安全吗?有保障吗?
Section 20 of Chapter 2: operators one
高校学生返校名单信息生成- 腾讯云场景连接器全国高校创新赛
关于最近面试总结
Self adaptive development of self defined navigation bar for wechat applet
Wechat applet rich text plugin parser
Guan Zhengxiong: implement QA generation algorithm based on pre training model and intelligent operation and maintenance
【报错】ValueError: It seems that you are using the Keras 2 and you are passing both
Win10如何把圖標發送到桌面
第二章 第二十六节:文件操作:文件修改
用权重的分布规则去初始化权重