<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.nekotype.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.nekotype.com/feed.php">
        <title>猫型iPS細胞研究所 reactnative:db</title>
        <description></description>
        <link>https://wiki.nekotype.com/</link>
        <image rdf:resource="https://wiki.nekotype.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-04-30T22:33:35+0900</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.nekotype.com/reactnative/db/asyncstorage?rev=1548567863&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nekotype.com/reactnative/db/realm?rev=1548567841&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.nekotype.com/reactnative/db/sqlite?rev=1550764507&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.nekotype.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>猫型iPS細胞研究所</title>
        <link>https://wiki.nekotype.com/</link>
        <url>https://wiki.nekotype.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://wiki.nekotype.com/reactnative/db/asyncstorage?rev=1548567863&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-01-27T14:44:23+0900</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>AsyncStorage</title>
        <link>https://wiki.nekotype.com/reactnative/db/asyncstorage?rev=1548567863&amp;do=diff</link>
        <description>AsyncStorage

stateの情報をそのまま保存することができる。
AsyncStorage

基本


import {AsyncStorage} from 'react-native';


データの保存


async Save(e){
          //AsycnStorageに保存
          try {
            console.log(&quot;保存START&quot;)
            const data = JSON.stringify(this.state.sheetData)
            await AsyncStorage.setItem('sheetData', data);
          } catch (err) {
            console.log(&quot;保存失敗&quot;)
            console.log(err)
          }
          console.log(&quot;保存成功&quot;)
  }…</description>
    </item>
    <item rdf:about="https://wiki.nekotype.com/reactnative/db/realm?rev=1548567841&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-01-27T14:44:01+0900</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Realm</title>
        <link>https://wiki.nekotype.com/reactnative/db/realm?rev=1548567841&amp;do=diff</link>
        <description>Realm

React Native で使えるデータベース。
Realm

基本


npm install --save realm
react-native link realm</description>
    </item>
    <item rdf:about="https://wiki.nekotype.com/reactnative/db/sqlite?rev=1550764507&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-02-22T00:55:07+0900</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>SQLite</title>
        <link>https://wiki.nekotype.com/reactnative/db/sqlite?rev=1550764507&amp;do=diff</link>
        <description>SQLite

expoに含まれるデータベース
SQLite

SQLite入門

基本

当たり前だが、パラメーター変数(？置換え)を使用する場合は、順番に気をつける必要がある。。。


import { Constants, SQLite } from 'expo';

const db = SQLite.openDatabase('SampleDatabase.db');

・・・
 componentDidMount(e){

    db.transaction(tx =&gt; {
      tx.executeSql(
        'create table if not exists items (id integer primary key not null, done int, value text);'
      );
    });

    db.transaction(
      tx =&gt; {
        tx.executeSql('insert into items (done, value) values (0, ?)', [&quot;safa&quot;])…</description>
    </item>
</rdf:RDF>
