{"id":1856,"date":"2017-08-09T07:31:33","date_gmt":"2017-08-08T22:31:33","guid":{"rendered":"http:\/\/okamurax.com\/?p=1856"},"modified":"2022-11-09T12:16:03","modified_gmt":"2022-11-09T03:16:03","slug":"sqlite%e3%81%be%e3%81%a8%e3%82%81","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=1856","title":{"rendered":"SQLite\u30e1\u30e2"},"content":{"rendered":"<h2>\u6e96\u5099<\/h2>\n<p><span style=\"color: #0000ff;\">sudo apt-get update<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo apt-get install sqlite3<\/span><\/p>\n<h2>\u57fa\u672c<\/h2>\n<p>DB\u3078\u306e\u4f5c\u6210\u3001\u63a5\u7d9a<br \/>\n<span style=\"color: #0000ff;\">sqlite3 xxx<\/span><\/p>\n<p>\u60c5\u5831\u78ba\u8a8d<br \/>\n<span style=\"color: #0000ff;\">.schema<\/span><\/p>\n<p>\u7d42\u4e86<br \/>\n<span style=\"color: #0000ff;\">.exit<\/span><\/p>\n<h2>\u30c7\u30fc\u30bf\u306e\u7a2e\u985e<\/h2>\n<p>\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u305d\u306e\u3082\u306e\u306bStorage Classes\u304c\u5b9a\u7fa9\u3055\u308c\u308b\u3002<br \/>\n\u30ab\u30e9\u30e0\u306e\u30c7\u30fc\u30bf\u578b\u3068\u306f\u9055\u3046(\u30ab\u30e9\u30e0\u306b\u8907\u6570\u306e\u30c7\u30fc\u30bf\u304c\u5165\u308b)<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbNULL<\/span><br \/>\n<span style=\"color: #0000ff;\">\u30fbTEXT<\/span><br \/>\n<span style=\"color: #0000ff;\"> \u30fbINTEGER<\/span><br \/>\n<span style=\"color: #0000ff;\"> \u30fbREAL<\/span><br \/>\n<span style=\"color: #0000ff;\"> \u30fbBLOB<\/span><\/p>\n<p>\u30ab\u30e9\u30e0\u306b\u63a8\u5968\u3055\u308c\u308b\u30c7\u30fc\u30bf\u578b(Type Affinity)\u3092\u5b9a\u7fa9\u3067\u304d\u3001\u683c\u7d0d\u6642\u306b\u30c7\u30fc\u30bf\u578b\u3092\u5909\u63db\u3059\u308b\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbTEXT<\/span><br \/>\nNULL\u3001TEXT\u3001BLOB\u306f\u305d\u306e\u307e\u307e\u3002<br \/>\n\u6570\u5024\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbNUMERIC<\/span><br \/>\nTEXT\u304c\u5165\u308b\u3068REAL\u3084INTEGER\u306b\u5909\u63db\u3002\u5909\u63db\u3067\u304d\u306a\u3044\u3068TEXT\u306e\u307e\u307e\u3002<br \/>\nNULL\u3001BLOB\u306f\u305d\u306e\u307e\u307e\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbINTEGER<\/span><br \/>\nNUMERIC\u3068\u540c\u3058\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbREAL<\/span><br \/>\nNUMERIC\u3068\u540c\u3058\u3002<br \/>\n\u6574\u6570\u306e\u5834\u5408\u3001\u5c0f\u6570\u306b\u5909\u63db\u3002<\/p>\n<p><span style=\"color: #0000ff;\">\u30fbBLOB<\/span><br \/>\n\u5909\u63db\u30ca\u30b7\u3002<\/p>\n<h2>\u30ad\u30fc\u30ef\u30fc\u30c9<\/h2>\n<p><span style=\"color: #0000ff;\">PRIMARY KEY\u3001ROWID\u3001AUTOINCREMENT<\/span><\/p>\n<p><span style=\"color: #0000ff;\">INTEGER PRIMARY KEY<\/span><br \/>\n\u3068\u8a2d\u5b9a\u3057\u3066\u3082\u81ea\u52d5\u3067\u5897\u52a0\u3059\u308b\u304c\u3001\u4ee5\u524d\u4f7f\u3063\u305f\u5024\u3092\u518d\u5ea6\u4f7f\u3046\u3002<\/p>\n<p><span style=\"color: #0000ff;\">INTEGER PRIMARY KEY AUTOINCREMENT<\/span><br \/>\n\u3068\u3059\u308b\u3068\u3001\u4ee5\u524d\u306e\u5024\u3092\u4f7f\u308f\u306a\u3044\u3002<\/p>\n<p><span style=\"color: #0000ff;\">create table xxx (id integer primary key autoincrement)<\/span><br \/>\n\u306e\u3088\u3046\u306a\u611f\u3058\u3002<\/p>\n<p><span style=\"color: #0000ff;\">NOT NULL\u3001UNIQUE\u3001DEFAULT\u3001CHECK<\/span><\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u3001\u524a\u9664\u306f\u6a19\u6e96<br \/>\ncreate,drop\u7b49\u3002<\/p>\n<p>\u4f8b)<br \/>\n<span style=\"color: #0000ff;\">create table news (<\/span><br \/>\n<span style=\"color: #0000ff;\"> id integer not null primary key autoincrement,<\/span><br \/>\n<span style=\"color: #0000ff;\"> title text not null,<\/span><br \/>\n<span style=\"color: #0000ff;\"> slug text not null,<\/span><br \/>\n<span style=\"color: #0000ff;\"> text text not null<\/span><br \/>\n<span style=\"color: #0000ff;\"> );<\/span><\/p>\n<h2>xampp\u3067\u306e\u5229\u7528<\/h2>\n<p>php.ini\u306e\u4ee5\u4e0b\u30b3\u30e1\u30f3\u30c8\u5916\u3059<br \/>\n<span style=\"color: #0000ff;\">extension=php_sqlite3.dll<\/span><\/p>\n<p><span style=\"color: #0000ff;\">application\\config\\database.php<\/span><br \/>\n\u306e\u4ee5\u4e0b\u3092\u4fee\u6b63<\/p>\n<p><span style=\"color: #0000ff;\">&#8216;database&#8217; =&gt; APPPATH.&#8217;sqlite\/db&#8217;,<\/span><br \/>\n<span style=\"color: #0000ff;\"> &#8216;dbdriver&#8217; =&gt; &#8216;sqlite3&#8217;,<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6e96\u5099 sudo apt-get update sudo apt-get install sqlite3 \u57fa\u672c DB\u3078\u306e\u4f5c\u6210\u3001\u63a5\u7d9a sqlite3 xxx \u60c5\u5831\u78ba\u8a8d .schema \u7d42\u4e86 .exit \u30c7\u30fc\u30bf\u306e\u7a2e\u985e \u683c\u7d0d\u3059\u308b &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=1856\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;SQLite\u30e1\u30e2&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1856","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/1856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1856"}],"version-history":[{"count":6,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/1856\/revisions"}],"predecessor-version":[{"id":5404,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/1856\/revisions\/5404"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}