{"id":78,"date":"2019-01-01T16:58:15","date_gmt":"2019-01-01T08:58:15","guid":{"rendered":"http:\/\/www.tairongkj.com\/?p=78"},"modified":"2019-01-13T20:39:23","modified_gmt":"2019-01-13T12:39:23","slug":"sqflite%e6%93%8d%e4%bd%9c%e7%9b%b8%e5%85%b3","status":"publish","type":"post","link":"https:\/\/www.tairongkj.com\/?p=78","title":{"rendered":"sqflite\u64cd\u4f5c\u76f8\u5173"},"content":{"rendered":"<div data-type=\"p\">SQLite \u63d2\u4ef6 \u540c\u65f6\u652f\u6301 iOS \u548cAndroid.<\/div>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">\u652f\u6301\u4e8b\u52a1\u548c\u6279\u5904\u7406<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">\u7248\u672c\u5f00\u653e\u81ea\u52a8\u7ba1\u7406<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">\u589e\u5220\u6539\u67e5\u52a9\u624b<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">iOS \u548c Android\u7684\u540e\u53f0\u7ebf\u7a0b\u4e2d\u6267\u884c\u7684DB\u64cd\u4f5c<\/div>\n<\/li>\n<\/ul>\n<h1 id=\"d4gcbr\" data-type=\"h\"><a id=\"\u5f00\u59cb\" class=\"anchor\" href=\"#d4gcbr\"><\/a>\u5f00\u59cb<\/h1>\n<div data-type=\"p\">\u5728\u60a8\u7684flutter\u9879\u76ee\u4e2d\u6dfb\u52a0\u4f9d\u8d56\u9879\uff1a<\/div>\n<blockquote>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">dependencies:\n  ...\n &nbsp;sqflite: any\n<\/code><\/pre>\n<\/blockquote>\n<div data-type=\"p\"><\/div>\n<h1 id=\"srqfbi\" data-type=\"h\"><a id=\"\u5f15\u7528\u793a\u4f8b\" class=\"anchor\" href=\"#srqfbi\"><\/a>\u5f15\u7528\u793a\u4f8b<\/h1>\n<div data-type=\"p\">Import&nbsp;<code>sqflite.dart<\/code><\/div>\n<pre data-syntax=\"plain\"><code class=\"language-plain\">import 'package:sqflite\/sqflite.dart';\n\n<\/code><\/pre>\n<div data-type=\"p\"><\/div>\n<h1 id=\"ymxtes\" data-type=\"h\"><a id=\"\u539f\u59cb\u7684sql\u67e5\u8be2\" class=\"anchor\" href=\"#ymxtes\"><\/a>\u539f\u59cb\u7684Sql\u67e5\u8be2<\/h1>\n<div data-type=\"p\">\u6267\u884c\u539f\u59cbSQL\u67e5\u8be2\u7684\u793a\u4f8b\u4ee3\u7801<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">\/\/ Get a location using getDatabasesPath\nvar databasesPath = await getDatabasesPath();\nString path = join(databasesPath, 'demo.db');\n\n\/\/ Delete the database\nawait deleteDatabase(path);\n\n\/\/ open the database\nDatabase database = await openDatabase(path, version: 1,\n    onCreate: (Database db, int version) async {\n  \/\/ When creating the db, create the table\n  await db.execute(\n      'CREATE TABLE Test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, num REAL)');\n});\n\n\/\/ Insert some records in a transaction\nawait database.transaction((txn) async {\n  int id1 = await txn.rawInsert(\n      'INSERT INTO Test(name, value, num) VALUES(\"some name\", 1234, 456.789)');\n  print('inserted1: $id1');\n  int id2 = await txn.rawInsert(\n      'INSERT INTO Test(name, value, num) VALUES(?, ?, ?)',\n      ['another name', 12345678, 3.1416]);\n  print('inserted2: $id2');\n});\n\n\/\/ Update some record\nint count = await database.rawUpdate(\n    'UPDATE Test SET name = ?, VALUE = ? WHERE name = ?',\n    ['updated name', '9876', 'some name']);\nprint('updated: $count');\n\n\/\/ Get the records\nList&lt;Map&gt; list = await database.rawQuery('SELECT * FROM Test');\nList&lt;Map&gt; expectedList = [\n  {'name': 'updated name', 'id': 1, 'value': 9876, 'num': 456.789},\n  {'name': 'another name', 'id': 2, 'value': 12345678, 'num': 3.1416}\n];\nprint(list);\nprint(expectedList);\nassert(const DeepCollectionEquality().equals(list, expectedList));\n\n\/\/ Count the records\ncount = Sqflite\n    .firstIntValue(await database.rawQuery('SELECT COUNT(*) FROM Test'));\nassert(count == 2);\n\n\/\/ Delete a record\ncount = await database\n    .rawDelete('DELETE FROM Test WHERE name = ?', ['another name']);\nassert(count == 1);\n\n\/\/ Close the database\nawait dat\n\n\n<\/code><\/pre>\n<h1 id=\"qk5qtu\" data-type=\"h\"><a id=\"sqlhelper(\u52a9\u624b)\" class=\"anchor\" href=\"#qk5qtu\"><\/a>SqlHelper(\u52a9\u624b)<\/h1>\n<div data-type=\"p\">\u4f7f\u7528\u52a9\u624b\u7684\u793a\u4f8b<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">inal String tableTodo = 'todo';\nfinal String columnId = '_id';\nfinal String columnTitle = 'title';\nfinal String columnDone = 'done';\n\nclass Todo {\n  int id;\n  String title;\n  bool done;\n\n  Map&lt;String, dynamic&gt; toMap() {\n    var map = &lt;String, dynamic&gt;{\n      columnTitle: title,\n      columnDone: done == true ? 1 : 0\n    };\n    if (id != null) {\n      map[columnId] = id;\n    }\n    return map;\n  }\n\n  Todo();\n\n  Todo.fromMap(Map&lt;String, dynamic&gt; map) {\n    id = map[columnId];\n    title = map[columnTitle];\n    done = map[columnDone] == 1;\n  }\n}\n\nclass TodoProvider {\n  Database db;\n\n  Future open(String path) async {\n    db = await openDatabase(path, version: 1,\n        onCreate: (Database db, int version) async {\n      await db.execute('''\ncreate table $tableTodo ( \n  $columnId integer primary key autoincrement, \n  $columnTitle text not null,\n  $columnDone integer not null)\n''');\n    });\n  }\n\n  Future&lt;Todo&gt; insert(Todo todo) async {\n    todo.id = await db.insert(tableTodo, todo.toMap());\n    return todo;\n  }\n\n  Future&lt;Todo&gt; getTodo(int id) async {\n    List&lt;Map&gt; maps = await db.query(tableTodo,\n        columns: [columnId, columnDone, columnTitle],\n        where: '$columnId = ?',\n        whereArgs: [id]);\n    if (maps.length &gt; 0) {\n      return Todo.fromMap(maps.first);\n    }\n    return null;\n  }\n\n  Future&lt;int&gt; delete(int id) async {\n    return await db.delete(tableTodo, where: '$columnId = ?', whereArgs: [id]);\n  }\n\n  Future&lt;int&gt; update(Todo todo) async {\n    return await db.update(tableTodo, todo.toMap(),\n        where: '$columnId = ?', whereArgs: [todo.id]);\n  }\n\n  Future close() async =&gt; db.close();\n}\n<\/code><\/pre>\n<h1 id=\"920mvf\" data-type=\"h\"><a id=\"transaction\" class=\"anchor\" href=\"#920mvf\"><\/a>Transaction<\/h1>\n<div data-type=\"p\">\u4e0d\u8981\u4f7f\u7528\u6570\u636e\u5e93\uff0c\u800c\u53ea\u5728\u4e8b\u52a1\u4e2d\u4f7f\u7528Transaction\u5bf9\u8c61\u6765\u8bbf\u95ee\u6570\u636e\u5e93<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">await database.transaction((txn) async {\n  \/\/ Ok\n  await txn.execute('CREATE TABLE Test1 (id INTEGER PRIMARY KEY)');\n  \n  \/\/ DON'T  use the database object in a transaction\n  \/\/ this will deadlock!\n  await database.execute('CREATE TABLE Test2 (id INTEGER PRIMARY KEY)');\n});\n<\/code><\/pre>\n<h1 id=\"tvt3lu\" data-type=\"h\"><a id=\"\u6279\u5904\u7406\u652f\u6301-\" class=\"anchor\" href=\"#tvt3lu\"><\/a>\u6279\u5904\u7406\u652f\u6301<\/h1>\n<div data-type=\"p\">\u4e3a\u4e86\u907f\u514d\u9891\u7e41\u7684\u4ea4\u4e92\uff0c\u53ef\u4ee5\u4f7f\u7528Batch\uff1a<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">batch = db.batch();\nbatch.insert('Test', {'name': 'item'});\nbatch.update('Test', {'name': 'new_item'}, where: 'name = ?', whereArgs: ['item']);\nbatch.delete('Test', where: 'name = ?', whereArgs: ['item']);\nresults = await batch.commit();\n<\/code><\/pre>\n<div data-type=\"p\">\u83b7\u53d6\u6bcf\u4e2a\u64cd\u4f5c\u7684\u7ed3\u679c\u90fd\u4f1a\u5e26\u6765\u6210\u672c\uff08\u63d2\u5165\u7684id\u548c\u66f4\u65b0\u548c\u5220\u9664\u7684\u66f4\u6539\u7684\u6570\u91cf\uff09\uff0c\u5c24\u5176\u662f\u5728\u6267\u884c\u989d\u5916SQL\u8bf7\u6c42\u7684Android\u4e0a\u3002\u5982\u679c\u4e0d\u5173\u5fc3\u7ed3\u679c\u5e76\u62c5\u5fc3\u6d88\u8017\u5927\u91cf\u8d44\u6e90\u548c\u6027\u80fd\uff0c\u53ef\u4ee5\u4f7f\u7528<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">await batch.commit(noResult: true);\n<\/code><\/pre>\n<div data-type=\"p\"><span style=\"color: #f5222d;\" data-type=\"color\">\u8b66\u544a\uff0c\u5728\u4e8b\u52a1\u671f\u95f4\uff0c\u5728\u63d0\u4ea4\u4e8b\u52a1\u4e4b\u524d\u4e0d\u4f1a\u63d0\u4ea4\u6279\u5904\u7406<\/span><\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">wait database.transaction((txn) async {\n  var batch = txn.batch();\n  \n  \/\/ ...\n  \n  \/\/ commit but the actual commit will happen when the transaction is commited\n  \/\/ however the data is available in this transaction\n  await batch.commit();\n  \n  \/\/  ...\n});\n<\/code><\/pre>\n<div data-type=\"p\"><\/div>\n<div data-type=\"p\">\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e00\u9047\u5230\u9519\u8bef\uff08\u901a\u5e38\u6062\u590d\u672a\u63d0\u4ea4\u7684\u66f4\u6539\uff09\uff0c\u6279\u5904\u7406\u5c31\u505c\u6b62\u3002\u60a8\u53ef\u4ee5\u5ffd\u7565\u9519\u8bef\uff0c\u5373\u4f7f\u78b0\u5230\u4e00\u4e2a\u64cd\u4f5c\u5931\u8d25\uff0c\u4e5f\u80fd\u8fd0\u884c\u548c\u63d0\u4ea4\u64cd\u4f5c\u6210\u529f\u6bcf\u4e2a\u63d0\u4ea4\uff1a<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">await batch.commit(continueOnError: true);\n<\/code><\/pre>\n<h1 id=\"2ftahf\" data-type=\"h\"><a id=\"\u8868\u548c\u5217\u540d\" class=\"anchor\" href=\"#2ftahf\"><\/a>\u8868\u548c\u5217\u540d<\/h1>\n<div data-type=\"p\">\u4e00\u822c\u6765\u8bf4\uff0c\u6700\u597d\u907f\u514d\u5bf9\u5b9e\u4f53\u540d\u79f0\u4f7f\u7528SQLite\u5173\u952e\u5b57\u3002\u5982\u679c\u4f7f\u7528\u4e0b\u5217\u540d\u79f0\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\uff1a<\/div>\n<pre data-syntax=\"sql\"><code class=\"language-sql\">\"add\",\"all\",\"alter\",\"and\",\"as\",\"autoincrement\",\"between\",\"case\",\"check\",\n\"collate\",\"commit\",\"constraint\",\"create\",\"default\",\"deferrable\",\"delete\",\n\"distinct\",\"drop\",\"else\",\"escape\",\"except\",\"exists\",\"foreign\",\"from\",\n\"group\",\"having\",\"if\",\"in\",\"index\",\"insert\",\"intersect\",\"into\",\"is\",\n\"isnull\",\"join\",\"limit\",\"not\",\"notnull\",\"null\",\"on\",\"or\",\"order\",\n\"primary\",\"references\",\"select\",\"set\",\"table\",\"then\",\"to\",\n\"transaction\",\"union\",\"unique\",\"update\",\"using\",\"values\",\"when\",\"where\"\n\n<\/code><\/pre>\n<div data-type=\"p\">\u52a9\u624b\u4f1a\u9003\u907f\u8fd9\u4e2a\u540d\u5b57\uff0c\u5982\u3002\u3002<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">db.query('table')\n<\/code><\/pre>\n<div data-type=\"p\">\u4ee5\u4e0a\u8fd9\u884c\u4ee3\u7801\u5c06\u7b49\u540c\u4e8e\u624b\u52a8\u5728\u8868\u540d\u5468\u56f4\u6dfb\u52a0\u53cc\u5f15\u53f7\uff08\u4ee4\u4eba\u56f0\u60d1\u7684\u662f\uff0c\u8fd9\u91cc\u547d\u540d\u7684\u8868\uff09,\u7b49\u540c\u4e8e\u5982\u4e0b\u4ee3\u7801<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">db.rawQuery('SELECT * FROM \"table\"');\n<\/code><\/pre>\n<div data-type=\"p\"><span style=\"color: #f5222d;\" data-type=\"color\">\u4f46\u662f\u5728\u4efb\u4f55\u5176\u4ed6\u539f\u59cb\u8bed\u53e5\uff08\u5305\u62ecorder.\u3001where\u3001group.\uff09\u4e2d\uff0c\u786e\u4fdd\u4f7f\u7528\u53cc\u5f15\u53f7\u6b63\u786e\u5730\u8f6c\u4e49\u540d\u79f0\u3002\u4f8b\u5982\uff0c\u53c2\u89c1\u4e0b\u9762\uff0c\u5217\u540d\u7ec4\u5728\u5217\u53c2\u6570\u4e2d\u6ca1\u6709\u8f6c\u4e49\uff0c\u800c\u662f\u5728where\u53c2\u6570\u4e2d\u8f6c\u4e49<\/span>\u3002<\/div>\n<pre data-syntax=\"ruby\"><code class=\"language-ruby\">db.query('table', columns: ['group'], where: '\"group\" = ?', whereArgs: ['my_group']);\n<\/code><\/pre>\n<h1 id=\"n4f2ig\" data-type=\"h\"><a id=\"sqlite-\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b-\" class=\"anchor\" href=\"#n4f2ig\"><\/a>SQLite&nbsp;\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b<\/h1>\n<div data-type=\"p\">Sqlite\u8fd8\u6ca1\u6709\u5bf9\u503c\u8fdb\u884c\u6709\u6548\u6027\u68c0\u67e5\uff0c\u56e0\u6b64\u8bf7\u907f\u514d\u4e0d\u652f\u6301\u7684\u7c7b\u578b<\/div>\n<div data-type=\"p\"><a class=\"bi-link\" href=\"https:\/\/www.sq..org\/datatype3.html\u3002\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">https:\/\/www.sq..org\/datatype3.html\u3002<br \/>\n<\/a><\/div>\n<h3 id=\"yxczzg\" data-type=\"h\"><a id=\"datetime\" class=\"anchor\" href=\"#yxczzg\"><\/a>DateTime<\/h3>\n<div data-type=\"p\"><span style=\"color: #f5222d;\" data-type=\"color\">SQLite\u4e0d\u652f\u6301DateTime\u7c7b\u578b<\/span>\u3002\u6211\u4e2a\u4eba\u5c06\u5b83\u4eec\u5b58\u50a8\u4e3aint\uff08.sSinceEpoch\uff09\u6216string\uff08iso8601\uff09<\/div>\n<h3 id=\"0zf0qu\" data-type=\"h\"><a id=\"bool\" class=\"anchor\" href=\"#0zf0qu\"><\/a>Bool<\/h3>\n<div data-type=\"p\"><span style=\"color: #f5222d;\" data-type=\"color\">SQLite\u4e0d\u652f\u6301bool\u7c7b\u578b<\/span>\u3002\u4f7f\u7528\u6574\u6570\u548c0\u548c1\u503c\u3002<\/div>\n<div data-type=\"p\"><\/div>\n<h3 id=\"integer\" data-type=\"h\"><a id=\"integer\" class=\"anchor\" href=\"#integer\"><\/a>INTEGER<\/h3>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Dart type:&nbsp;<code>int<\/code><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">\u53d6\u503c\u8303\u56f4: \u4ece-2^63 \u5230 2^63 &#8211; 1<\/div>\n<\/li>\n<\/ul>\n<div data-type=\"p\"><\/div>\n<h3 id=\"real\" data-type=\"h\"><a id=\"real\" class=\"anchor\" href=\"#real\"><\/a>REAL<\/h3>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Dart type:&nbsp;<code>num<\/code><\/div>\n<\/li>\n<\/ul>\n<div data-type=\"p\"><\/div>\n<h3 id=\"text\" data-type=\"h\"><a id=\"text\" class=\"anchor\" href=\"#text\"><\/a>TEXT<\/h3>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Dart type:&nbsp;<code>String<\/code><\/div>\n<\/li>\n<\/ul>\n<h3 id=\"blob\" data-type=\"h\"><a id=\"blob\" class=\"anchor\" href=\"#blob\"><\/a>BLOB<\/h3>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Dart type:&nbsp;<code>Uint8List<\/code><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Dart type&nbsp;<code>List&lt;int&gt;<\/code>&nbsp;\u662f\u652f\u6301\u7684\uff0c\u4f46\u662f\u4e0d\u63a8\u8350\u4f7f\u7528 \u6162\u901f\u8f6c\u6362)<\/div>\n<\/li>\n<\/ul>\n<h1 id=\"gwgsye\" data-type=\"h\"><a id=\"\u5f53\u524d\u95ee\u9898\" class=\"anchor\" href=\"#gwgsye\"><\/a>\u5f53\u524d\u95ee\u9898<\/h1>\n<div data-type=\"p\"><\/div>\n<ul data-type=\"unordered-list\">\n<li style=\"list-style-type: none\">\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Due to the way transaction works in SQLite (threads), concurrent read and write transaction are not supported. All calls are currently synchronized and transactions block are exclusive. I thought that a basic way to support concurrent access is to open a database multiple times but it only works on iOS as Android reuses the same database object. I also thought a native thread could be a potential future solution however on android accessing the database in another thread is blocked while in a transaction&#8230;<\/div>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul data-type=\"unordered-list\">\n<li data-type=\"list-item\" data-list-type=\"unordered-list\">\n<div data-type=\"p\">Currently INTEGER are limited to -2^63 to 2^63 &#8211; 1 (although Android supports bigger ones)<\/div>\n<\/li>\n<\/ul>\n<blockquote>\n<div data-type=\"p\">\u4e0a\u8ff0\u673a\u7ffb<\/div>\n<div data-type=\"p\">\u7531\u4e8e\u4e8b\u52a1\u5728SQLIT\uff08\u7ebf\u7a0b\uff09\u4e2d\u7684\u5de5\u4f5c\u65b9\u5f0f\uff0c\u4e0d\u652f\u6301\u5e76\u53d1\u8bfb\u5199\u4e8b\u52a1\u3002\u6240\u6709\u8c03\u7528\u5f53\u524d\u90fd\u662f\u540c\u6b65\u7684\uff0c\u4e8b\u52a1\u5757\u662f\u72ec\u5360\u7684\u3002\u6211\u8ba4\u4e3a\u652f\u6301\u5e76\u53d1\u8bbf\u95ee\u7684\u57fa\u672c\u65b9\u6cd5\u662f\u591a\u6b21\u6253\u5f00\u6570\u636e\u5e93\uff0c\u4f46\u662f\u5b83\u53ea\u80fd\u5728iOS\u4e0a\u5de5\u4f5c\uff0c\u56e0\u4e3aAndroid\u91cd\u7528\u4e86\u76f8\u540c\u7684\u6570\u636e\u5e93\u5bf9\u8c61\u3002\u6211\u8fd8\u8ba4\u4e3a\u672c\u673a\u7ebf\u7a0b\u53ef\u80fd\u662f\u672a\u6765\u53ef\u80fd\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4f46\u662f\u5f53android\u8bbf\u95ee\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\u7684\u6570\u636e\u5e93\u65f6\uff0c\u5728\u4e8b\u52a1\u4e2d\u4f1a\u963b\u585e\u2026\u2026<\/div>\n<div data-type=\"p\">\u76ee\u524dINTEGER\u88ab\u9650\u5236\u5728-2^63\u52302^63-1\uff08\u5c3d\u7ba1Android\u652f\u6301\u66f4\u5927\u7684\uff09<\/div>\n<\/blockquote>\n<h2 id=\"more\" data-type=\"h\"><a id=\"\u66f4\u591a\" class=\"anchor\" href=\"#more\"><\/a>\u66f4\u591a<\/h2>\n<div data-type=\"p\"><a class=\"bi-link\" href=\"https:\/\/github.com\/tekartik\/sqflite\/blob\/master\/doc\/how_to.md\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">\u66f4\u591a\u4f7f\u7528\u793a\u4f8b<\/a><\/div>\n<div data-type=\"p\"><\/div>\n<h1 id=\"ek74hh\" data-type=\"h\"><a id=\"\u76f8\u5173\u7c7b\u5e93\" class=\"anchor\" href=\"#ek74hh\"><\/a>\u76f8\u5173\u7c7b\u5e93<\/h1>\n<div data-type=\"p\"><a class=\"bi-link\" href=\"https:\/\/pub.dartlang.org\/documentation\/sqflite\/latest\/sqflite\/sqflite-library.html\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">sqflite<\/a><\/div>\n<div data-type=\"p\"><a class=\"bi-link\" href=\"https:\/\/pub.dartlang.org\/documentation\/sqflite\/latest\/sql\/sql-library.html\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">sql<\/a><\/div>\n<div data-type=\"p\"><\/div>\n<hr id=\"q6wgwk\">\n<div data-type=\"p\">by phoenix\u7ffb\u8bd1\uff0c<a class=\"bi-link\" href=\"https:\/\/pub.dartlang.org\/documentation\/sqflite\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">\u539f\u6587\u8f6c\u81ea<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>SQLite \u63d2\u4ef6 \u540c\u65f6\u652f\u6301 iOS \u548cAndroid. \u652f\u6301\u4e8b\u52a1\u548c\u6279\u5904\u7406 \u7248\u672c\u5f00\u653e\u81ea\u52a8\u7ba1\u7406 \u589e\u5220\u6539\u67e5\u52a9\u624b i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":79,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[5],"series":[23],"class_list":{"0":"post-78","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-flutterstudys","8":"tag-flutter","9":"series-flutter","11":"post-with-thumbnail","12":"post-with-thumbnail-large"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78"}],"version-history":[{"count":4,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":917,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions\/917"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=\/wp\/v2\/media\/79"}],"wp:attachment":[{"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.tairongkj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}