{"id":11322,"date":"2023-01-23T07:00:20","date_gmt":"2023-01-22T22:00:20","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11322"},"modified":"2022-12-17T19:58:51","modified_gmt":"2022-12-17T10:58:51","slug":"laravel-react-sqlite%ef%bc%88wasm-%e7%89%88%ef%bc%89%e3%81%a7%e3%83%ad%e3%83%bc%e3%82%ab%e3%83%ab%e3%83%bb%e3%83%96%e3%83%83%e3%82%af%e3%83%9e%e3%83%bc%e3%82%af%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11322","title":{"rendered":"Laravel + React +SQLite\uff08Wasm \u7248\uff09\u3067\u30ed\u30fc\u30ab\u30eb\u30fb\u30d6\u30c3\u30af\u30de\u30fc\u30af\u6a5f\u80fd\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u77e5\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3084\u3089<code>JavaScript<\/code>\u3067<code>wasm<\/code>\uff08<code>Webassembly<\/code>\uff09\u3067\u3042\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3092\u77e5\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">SQLite\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>wasm<\/code>\u3092\u4f7f\u3046\u3053\u3068\u3067\u300c<strong>\u30d6\u30e9\u30a6\u30b6\u3060\u3051\u3067SQLite<\/strong>\u300d\u3092\u52d5\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong>\u00a0<a href=\"https:\/\/blog.capilano-fw.com\/?p=5446#WebAssembly\" target=\"_blank\" rel=\"noopener\">WebAssembly\u3068\u306f\uff1f<\/a><\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u306a\u3093\u304b\u9762\u767d\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u3001\u300c<strong>Laravel + React<\/strong>\u300d\u306e\u74b0\u5883\u3067\u4f7f\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u6a5f\u80fd\u306f\u300c<strong>\uff08\u30a6\u30a7\u30d6\u306a\u306e\u306b\uff09\u30ed\u30fc\u30ab\u30eb\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308b\u30d6\u30c3\u30af\u30de\u30fc\u30af<\/strong>\u300d\u3067\u3059\u3002\uff08\u9700\u8981\u306f\u5ea6\u5916\u8996\u3067\u3059\u304c\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u79d8\u5bc6\u306e\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306a\u3093\u304b\u306b\u3082\u4f7f\u3048\u308b\u304b\u3082\u3067\u3059\u306d\ud83d\udc4d\uff09<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9809 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/11\/no_9.png\" alt=\"\" width=\"370\" height=\"220\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/11\/no_9.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/11\/no_9-300x178.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300cTikTok \u3067\u82f1\u8a9e\u30ea\u30b9\u30cb\u30f3\u30b0<br \/>\n\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u4e2d\u3002<br \/>\n\u6d77\u5916\u6848\u4ef6\u72d9\u3046\u305e\u2757\uff08\u3067\u304d\u308c\u3070\u5186\u5b89\u4e2d\u306b\u2026\uff09\u300d<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306e\u6a5f\u80fd\u3067\u5229\u7528\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\uff12\u3064\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm i sql.js vite-plugin-static-copy --save-dev<\/strong><\/pre>\n<h1>Vite \u3067 sql-wasm.wasm \u304c\u30b3\u30d4\u30fc\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h1>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3089\u3001\u6b21\u306b<code>wasm<\/code>\u30d5\u30a1\u30a4\u30eb\u304c\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>vite.config.js<\/strong><\/p>\n<pre>import { defineConfig } from 'vite';\r\nimport laravel from 'laravel-vite-plugin';\r\nimport react from '@vitejs\/plugin-react';\r\n<strong>import { viteStaticCopy } from 'vite-plugin-static-copy' \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n\r\nexport default defineConfig({\r\n    plugins: [\r\n        laravel({\r\n            input: 'resources\/js\/app.jsx',\r\n            ssr: 'resources\/js\/ssr.jsx',\r\n            refresh: true,\r\n        }),\r\n        react(),\r\n        <strong>viteStaticCopy({ \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n<strong>            targets: [<\/strong>\r\n<strong>                {<\/strong>\r\n<strong>                    src: 'node_modules\/sql.js\/dist\/sql-wasm.wasm',<\/strong>\r\n<strong>                    dest: 'wasm'<\/strong>\r\n<strong>                }<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        })<\/strong>\r\n    ]\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n});<\/pre>\n<p>\u3053\u308c\u3067<code>sql.js<\/code>\u306e\u4e2d\u306b\u3042\u308b<code>sql-wasm.wasm<\/code>\u304c\u30d3\u30eb\u30c9\u3059\u308b\u5ea6\u306b\u30b3\u30d4\u30fc\u3055\u308c\u308b\uff08\uff1d\u3064\u307e\u308a\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3042\u3063\u3066\u3082\u81ea\u52d5\u3067\u65b0\u3057\u3044\u3082\u306e\u306b\u7f6e\u304d\u63db\u308f\u308b\uff09\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059 \ud83d\udc4d<\/p>\n<p>\u3067\u306f\u3001\u65e9\u901f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>npm run build<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u300c<strong>http:\/\/*******\/build\/wasm\/sql-wasm.wasm<\/strong>\u300d\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11323\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_1.png\" alt=\"\" width=\"294\" height=\"167\" \/><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u6e96\u5099\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u3053\u304b\u3089\u306f\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u2757<\/p>\n<p>\u307e\u305a\u306f\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<div>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>Route::get('wasm_sqlite_bookmark', fn() =&gt; Inertia::render('WasmSqliteBookmark\/Index'));<\/strong><\/pre>\n<\/div>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u3069\u3053\u308d\u306e\u30d3\u30e5\u30fc\u3067\u3059\u3002<br \/>\n\u3061\u3087\u3063\u3068\u30b3\u30fc\u30c9\u304c\u9577\u3044\u3067\u3059\u304c\u3001\u305d\u3053\u307e\u3067\u8907\u96d1\u306a\u90e8\u5206\u306f\u306a\u3044\u306e\u3067\u305c\u3072\u9806\u306b\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>resources\/js\/Pages\/WasmSqliteBookmark\/Index.jsx<\/strong><\/p>\n<div>\n<pre><strong>import initSqlJs from 'sql.js'<\/strong>\r\n<strong>import {useEffect, useRef, useState} from \"react\";<\/strong>\r\n\r\n<strong>export default function Index() {<\/strong>\r\n\r\n<strong>    \/\/ DB<\/strong>\r\n<strong>    const db = useRef(null);<\/strong>\r\n<strong>    useEffect(() =&gt; {<\/strong>\r\n\r\n<strong>        initializeDb();<\/strong>\r\n\r\n<strong>    }, []);<\/strong>\r\n<strong>    const initializeDb = (data = null) =&gt; {<\/strong>\r\n\r\n<strong>        \/\/ Wasm \u306e\u6307\u5b9a<\/strong>\r\n<strong>        const config = {<\/strong>\r\n<strong>            locateFile() {<\/strong>\r\n\r\n<strong>                return  '\/build\/wasm\/sql-wasm.wasm'<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        \/\/ SQLite \u3092\u521d\u671f\u5316<\/strong>\r\n<strong>        initSqlJs(config)<\/strong>\r\n<strong>            .then(SQL =&gt; {<\/strong>\r\n\r\n<strong>                db.current = new SQL.Database(data);<\/strong>\r\n\r\n<strong>                if(! data) { \/\/ \u521d\u671f\u306e\u5834\u5408\u306f\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210<\/strong>\r\n\r\n<strong>                    const sql = `CREATE TABLE bookmarks (<\/strong>\r\n<strong>                                    id INTEGER PRIMARY KEY AUTOINCREMENT,<\/strong>\r\n<strong>                                    title varchar(255) NOT NULL,<\/strong>\r\n<strong>                                    url varchar(255) NOT NULL,<\/strong>\r\n<strong>                                    created_at datetime NOT NULL<\/strong>\r\n<strong>                                );`<\/strong>\r\n<strong>                    db.current.run(sql);<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                loadBookmarks();<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    \/\/ \u30d6\u30c3\u30af\u30de\u30fc\u30af<\/strong>\r\n<strong>    const [bookmarks, setBookmarks] = useState([]);<\/strong>\r\n<strong>    const handleFileSelected = e =&gt; { \/\/ \u30d5\u30a1\u30a4\u30eb\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d<\/strong>\r\n\r\n<strong>        const files = e.target.files;<\/strong>\r\n\r\n<strong>        if(files.length &gt; 0) {<\/strong>\r\n\r\n<strong>            const file = files[0];<\/strong>\r\n<strong>            const reader = new FileReader();<\/strong>\r\n<strong>            reader.onload = () =&gt; {<\/strong>\r\n\r\n<strong>                const data = new Uint8Array(reader.result); \/\/ \u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u30c7\u30fc\u30bf\u5316<\/strong>\r\n<strong>                initializeDb(data); \/\/ DB \u3092\u521d\u671f\u5316<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>            reader.readAsArrayBuffer(file);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const loadBookmarks = () =&gt; { \/\/ SQLite \u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u8aad\u307f\u8fbc\u3080<\/strong>\r\n\r\n<strong>        let newBookmarks = [];<\/strong>\r\n<strong>        const stmt = db.current.prepare('SELECT id, title, url, created_at FROM bookmarks;');<\/strong>\r\n<strong>        stmt.getAsObject();<\/strong>\r\n\r\n<strong>        while(stmt.step()) {<\/strong>\r\n\r\n<strong>            const row = stmt.getAsObject();<\/strong>\r\n<strong>            newBookmarks.push(row);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        setBookmarks(newBookmarks);<\/strong>\r\n<strong>    };<\/strong>\r\n\r\n<strong>    \/\/ \u30d1\u30e9\u30e1\u30fc\u30bf<\/strong>\r\n<strong>    const [title, setTitle] = useState('');<\/strong>\r\n<strong>    const [url, setUrl] = useState('');<\/strong>\r\n<strong>    const handleSaveBookmarkClick = () =&gt; {<\/strong>\r\n\r\n<strong>        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u307e\u3059<\/strong>\r\n\r\n<strong>        const sql = `INSERT INTO<\/strong>\r\n<strong>                        bookmarks (title, url, created_at)<\/strong>\r\n<strong>                        VALUES (?, ?, datetime('now'));`;<\/strong>\r\n<strong>        const params = [title, url];<\/strong>\r\n<strong>        db.current.run(sql, params);<\/strong>\r\n\r\n<strong>        \/\/ \u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u521d\u671f\u5316<\/strong>\r\n<strong>        setTitle('');<\/strong>\r\n<strong>        setUrl('');<\/strong>\r\n\r\n<strong>        loadBookmarks();<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    \/\/ \u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8<\/strong>\r\n<strong>    const handleDownloadClick = () =&gt; {<\/strong>\r\n\r\n<strong>        const data = db.current.export();<\/strong>\r\n<strong>        const blob = new Blob([data], {<\/strong>\r\n<strong>            type: 'application\/octet-stream'<\/strong>\r\n<strong>        });<\/strong>\r\n<strong>        const downloadUrl = window.URL.createObjectURL(blob);<\/strong>\r\n<strong>        const link = document.createElement('a');<\/strong>\r\n<strong>        const dateTime = new Date().toLocaleString().replace(\/:\/g, '-');<\/strong>\r\n<strong>        const filename = `bookmark_${dateTime}.sqlite`;<\/strong>\r\n\r\n<strong>        \/\/ \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong>\r\n<strong>        link.href = downloadUrl;<\/strong>\r\n<strong>        link.download = filename;<\/strong>\r\n<strong>        document.body.appendChild(link);<\/strong>\r\n<strong>        link.style = 'display:none';<\/strong>\r\n<strong>        link.click();<\/strong>\r\n<strong>        link.remove();<\/strong>\r\n\r\n<strong>        setTimeout(() =&gt; {<\/strong>\r\n\r\n<strong>            return window.URL.revokeObjectURL(downloadUrl); \/\/ \u30e1\u30e2\u30ea\u89e3\u653e<\/strong>\r\n\r\n<strong>        }, 1000);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5\"&gt;<\/strong>\r\n<strong>            &lt;div className=\"mb-3\"&gt;<\/strong>\r\n<strong>                &lt;button type=\"button\" className=\"text-white bg-blue-700 font-medium rounded text-sm px-3 py-2.5 mr-2 mb-2\" onClick={handleDownloadClick}&gt;<\/strong>\r\n<strong>                    \u30d6\u30c3\u30af\u30de\u30fc\u30af\uff08SQLite\uff09\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong>\r\n<strong>                &lt;\/button&gt;<\/strong>\r\n<strong>                &lt;label className=\"text-white bg-gray-700 font-medium rounded text-sm px-3 py-2.5 mr-2 mb-2 cursor-pointer\"&gt;<\/strong>\r\n<strong>                    &lt;input<\/strong>\r\n<strong>                        type=\"file\"<\/strong>\r\n<strong>                        className=\"hidden\"<\/strong>\r\n<strong>                        onChange={handleFileSelected} \/&gt;<\/strong>\r\n<strong>                    \u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u8aad\u307f\u8fbc\u3080<\/strong>\r\n<strong>                &lt;\/label&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;hr \/&gt;<\/strong>\r\n<strong>            &lt;div className=\"px-3 py-5\"&gt;<\/strong>\r\n<strong>                {bookmarks.length &gt; 0 &amp;&amp; (<\/strong>\r\n<strong>                    bookmarks.map(bookmark =&gt; (<\/strong>\r\n<strong>                        &lt;div key={bookmark.id} className=\"mb-3\"&gt;<\/strong>\r\n<strong>                            &amp;#x1F4DD; &lt;a href={bookmark.url} className=\"text-blue-700 font-medium font-bold\" target=\"_blank\"&gt;{bookmark.title}&lt;\/a&gt;<\/strong>\r\n<strong>                        &lt;\/div&gt;<\/strong>\r\n<strong>                    ))<\/strong>\r\n<strong>                ) || (<\/strong>\r\n<strong>                bookmarks.length === 0 &amp;&amp; (<\/strong>\r\n<strong>                    &lt;small&gt;\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002\u4ee5\u4e0b\u304b\u3089\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/small&gt;<\/strong>\r\n<strong>                ))}<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div className=\"border border-1 bg-gray-200 p-3\"&gt;<\/strong>\r\n<strong>                &lt;small&gt;\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u8ffd\u52a0\u3059\u308b&lt;\/small&gt;<\/strong>\r\n<strong>                &lt;div className=\"mb-3\"&gt;<\/strong>\r\n<strong>                    &lt;input type=\"text\" value={title} onChange={e =&gt; setTitle(e.target.value)} placeholder=\"\u30bf\u30a4\u30c8\u30eb\" \/&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div className=\"mb-3\"&gt;<\/strong>\r\n<strong>                    &lt;input type=\"text\" value={url} onChange={e =&gt; setUrl(e.target.value)} placeholder=\"URL\" \/&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;button<\/strong>\r\n<strong>                    type=\"button\"<\/strong>\r\n<strong>                    className=\"text-white bg-orange-500 font-medium rounded text-sm px-2 py-1.5 mr-2 mb-2\"<\/strong>\r\n<strong>                    onClick={handleSaveBookmarkClick}&gt;<\/strong>\r\n<strong>                    \u8ffd\u52a0\u3059\u308b<\/strong>\r\n<strong>                &lt;\/button&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u91cd\u8981\u306a\u90e8\u5206\u3092\u3072\u3068\u3064\u305a\u3064\u7d39\u4ecb\u3057\u3066\u304d\u307e\u3059\u3002<\/p>\n<h2>DB<\/h2>\n<p><code>initSqlJs()<\/code>\u306f\u3001<code>sql.js<\/code>\u306e\u95a2\u6570\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u3067\u3001<code>SQLite<\/code>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u305f\u3081\u306b\u306f\u5148\u307b\u3069<code>Vite<\/code>\u306e\u65b9\u3067\u81ea\u52d5\u30b3\u30d4\u30fc\u3067\u304d\u308b\u3088\u3046\u3057\u305f\u300c<strong>wasm\u30d5\u30a1\u30a4\u30eb<\/strong>\u300d\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u308c\u304c\u3001\u300c<strong>Wasm \u306e\u6307\u5b9a<\/strong>\u300d\u306b\u3042\u308b<code>locateFile<\/code>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>initializeDb()<\/code>\u306f\u3001\u4ee5\u4e0b\uff12\u3064\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u306f\u3058\u3081\u306b\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u3068\u304d<\/li>\n<li>\u3059\u3067\u306b\u4fdd\u5b58\u3057\u305f\u30d6\u30c3\u30af\u30de\u30fc\u30af\u30d5\u30a1\u30a4\u30eb\uff08SQLite\uff09\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d<\/li>\n<\/ul>\n<p>\u305d\u306e\u305f\u3081\u3001\u5f15\u6570\u306e\u521d\u671f\u5024\u306f<code>null<\/code>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306f<code>data<\/code>\u306b\u4e2d\u8eab\u304c\u5165\u3063\u3066\u3044\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\uff09<\/p>\n<h1>\u30d6\u30c3\u30af\u30de\u30fc\u30af<\/h1>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u3001<code>SQLite<\/code>\u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u6a5f\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u5f8c\u3067\u300c<strong>\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8<\/strong>\u300d\u90e8\u5206\u306b\u3082\u51fa\u3066\u304d\u307e\u3059\u304c\u3001<code>SQLite<\/code>\u306e\u4fdd\u5b58\u30c7\u30fc\u30bf\u306f<code>Uint<\/code>\u306e\u305f\u3081\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30d5\u30a1\u30a4\u30eb\u306f\u5f62\u5f0f\u3092\u5909\u63db\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>SQLite<\/code>\u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u30fb\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\u306e\u304c<code>loadBookmarks()<\/code>\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3063\u3066\u3082\u3001\u3053\u3053\u306f<code>SQL<\/code>\u6587\u3092\u767a\u884c\u3057\u3066<code>bookmarks<\/code>\u306e\u4e2d\u8eab\u3092<code>setBookmarks()<\/code>\u3067\u5909\u66f4\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<h2>\u30d1\u30e9\u30e1\u30fc\u30bf<\/h2>\n<p>\u3053\u3053\u306f\u3001\u65b0\u3057\u3044\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092<code>SQLite<\/code>\u3078\u8ffd\u52a0\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u6d41\u308c\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>INSET \u6587\u3092\u767a\u884c\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0<\/li>\n<li>\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3082\u3046\u3044\u3089\u306a\u3044\u306e\u3067\u521d\u671f\u5316<\/li>\n<li>SELECT \u6587\u3092\u767a\u884c\u3057\u3066\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080<\/li>\n<\/ol>\n<p>\u203b \u306a\u304a\u3001\u30b3\u30e1\u30f3\u30c8\u306b\u3082\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u5168\u304f\u66f8\u3044\u3066\u307e\u305b\u3093\u3002\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002m(_ _)m<\/p>\n<h2>\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8<\/h2>\n<p><code>wasm<\/code>\u306f\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u52d5\u3044\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u30da\u30fc\u30b8\u304c\u30ea\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3068\u305d\u306e\u5185\u5bb9\u306f\u5931\u308f\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u8ffd\u52a0\u3057\u305f\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u306e\u304c\u3053\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u306f\u5c11\u3057\u9577\u3044\u3067\u3059\u304c\u3001<code>DB<\/code>\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u3092<code>JavaScript<\/code>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u300c<strong>\u30e1\u30e2\u30ea\u89e3\u653e<\/strong>\u300d\u306e\u90e8\u5206\u306f\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3069\u3046\u3082\u3053\u308c\u304c\u306a\u3044\u3068\u30e1\u30e2\u30ea\u304c\u958b\u653e\u3055\u308c\u305a\u3001\u6700\u60aa\u306e\u5834\u5408\u30d6\u30e9\u30a6\u30b6\u304c\u52d5\u304b\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002\uff08\u30ad\u30e3\u30c3\u30c1\u30fb\u30a2\u30f3\u30c9\u30fb\u30ea\u30ea\u30fc\u30b9\u3067\u3059\uff01\uff09<\/p>\n<p>\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u3068\u3066\u3082\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong> <a href=\"https:\/\/note.affi-sapo-sv.com\/js-create-revoke-objecturl.php\">JavaScript\u3011 createObjectURL()\u3057\u305f\u5f8c\u306brevokeObjectURL()\u304c\u5fc5\u8981\u306a\u7406\u7531<\/a><\/p>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u2757<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude04\ud83d\udc4d<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a\u306f<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u3066\u300c<strong>http:\/\/******\/wasm_sqlite_bookmark<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11332\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2.png\" alt=\"\" width=\"578\" height=\"355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2.png 578w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2-300x184.png 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/p>\n<p>\u3067\u306f\u3001\u307e\u3060\u30d6\u30c3\u30af\u30de\u30fc\u30af\u304c\u306a\u3044\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u300c<strong>\u8ffd\u52a0\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11331\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_3.png\" alt=\"\" width=\"253\" height=\"183\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11330\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_4.png\" alt=\"\" width=\"573\" height=\"363\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_4.png 573w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_4-300x190.png 300w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u65b0\u3057\u3044\u30ea\u30f3\u30af\u304c\u767b\u5834\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u8981\u9818\u3067\uff13\u3064\u307b\u3069\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11329\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_5.png\" alt=\"\" width=\"228\" height=\"129\" \/><\/p>\n<p>\u203b \u6700\u5f8c\u3060\u3051\u306f\u3053\u306e\u30d6\u30ed\u30b0\u3067\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3057\u307e\u3057\u305f \ud83d\udc4d<\/p>\n<p>\u305d\u3057\u3066\u3001\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\uff08\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\uff09\u304c\u3067\u304d\u308b\u304b\u3092\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11328\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_6.png\" alt=\"\" width=\"572\" height=\"66\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_6.png 572w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_6-300x35.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11326\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_8.png\" alt=\"\" width=\"267\" height=\"84\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u81ea\u52d5\u3067\u958b\u59cb\u3055\u308c\u3001\u30d6\u30e9\u30a6\u30b6\u306b\u8868\u793a\u304c\u3067\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u4e00\u65e6\u30da\u30fc\u30b8\u3092\u30ea\u30ed\u30fc\u30c9\u3057\u3001\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11332\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2.png\" alt=\"\" width=\"578\" height=\"355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2.png 578w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_2-300x184.png 300w\" sizes=\"auto, (max-width: 578px) 100vw, 578px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u3001\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\uff06\u5148\u307b\u3069\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f<code>SQLite<\/code>\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9078\u629e\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11327\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_7.png\" alt=\"\" width=\"572\" height=\"66\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_7.png 572w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_7-300x35.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/p>\n<p>\u3046\u307e\u304f\u3044\u304f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11333\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_9.png\" alt=\"\" width=\"570\" height=\"436\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_9.png 570w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/12\/laravel_react_sqlite_webassembly_9-300x229.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u5148\u307b\u3069\u8ffd\u52a0\u3057\u305f\u5185\u5bb9\u3092\u5fa9\u6d3b\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude04\u2728<\/p>\n<h1>\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u7528\u610f\u3057\u307e\u3057\u305f<\/h1>\n<p>\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u7528\u610f\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305c\u3072\u5b9f\u969b\u306b\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\ud83d\udcdd <a href=\"https:\/\/demo-laravel9x-vite.capilano-fw.com\/wasm_sqlite_bookmark\" target=\"_blank\" rel=\"noopener\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a><\/strong><\/p>\n<p>\u203b \u5192\u982d\u3067\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u306b\u30c7\u30fc\u30bf\u304c\u9001\u3089\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001\u79d8\u5bc6\u306e\u30d6\u30c3\u30af\u30de\u30fc\u30af\u3068\u3057\u3066\u666e\u6bb5\u9063\u3044\u3057\u3066\u3082\u3089\u3063\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\ud83d\udc4d<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306b<code>wasm<\/code>\uff08<code>Webassembly<\/code>\uff09\u3092\u4f7f\u3046\u3068\u3001\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30b3\u30fc\u30c9\u304c\u5206\u96e2\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u5f37\u3044<\/li>\n<li>\u30d0\u30a4\u30ca\u30ea\u5316\u3055\u308c\u3066\u3044\u308b\uff08\u6a5f\u68b0\u304c\u8aad\u307f\u3084\u3059\u3044\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u308b\uff09\u306e\u3067\u9ad8\u901f\u306b\u5b9f\u884c\u3067\u304d\u308b<\/li>\n<\/ul>\n<p>\u3082\u3057<code>Webassembly<\/code>\u3092\u4f7f\u3063\u305f\u958b\u767a\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Webassembly<\/code>\u306e<code>SQLite<\/code>\u3092\u4f7f\u3063\u3066\u30d6\u30c3\u30af\u30de\u30fc\u30af\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f<code>Webassembly<\/code>\u306f<code>Wasmer<\/code>\u3092\u4f7f\u3063\u3066\u300c<strong>\u3069\u3093\u306a\u74b0\u5883\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b<\/strong>\u300d\u3088\u3046\u3067\u304d\u308b\u305f\u3081\u3001\u6ce8\u76ee\u3057\u3066\u3044\u308b\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u306e\u3072\u3068\u3064\u3067\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001<code>Webassembly<\/code>\u306f\u6700\u8fd1\u4eba\u6c17\u306b\u306a\u3063\u3066\u3044\u308b<code>Rust<\/code>\u8a00\u8a9e\u304b\u3089\u3067\u3082\u3064\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff08\u203b\u4ee5\u4e0b\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff09\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u306e\u6d41\u308c\u306b\u306e\u3063\u3066\u3044\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a\u00a0<\/strong><a href=\"https:\/\/blog.capilano-fw.com\/?p=9376\" target=\"_blank\" rel=\"noopener\">WebAssembly \u3092 Rust \u3067\u3064\u304f\u308a\u3001JavaScript \u3067\u3064\u304b\u3046<\/a><\/p>\n<p>\u672a\u6765\u4e88\u60f3\u306f\u305d\u3053\u307e\u3067\u5f97\u610f\u3058\u3083\u306a\u3044\u3067\u3059\u3051\u3069\u3001\u305c\u3072\u7686\u3055\u3093\u3082\u7814\u7a76\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><br \/>\n\u300c\u53e3\u547c\u5438 \u2192 \u9f3b\u547c\u5438<br \/>\n\u3067\u4f53\u8abf\u5fa9\u6d3b\u2757\u300d<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u77e5\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3084\u3089JavaScript\u3067wasm\uff08Webassembly\uff09\u3067\u3042\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3092\u77e5\u308a\u307e\u3057\u305f\u3002 \u305d\u308c\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb SQLi &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11322\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + React +SQLite\uff08Wasm \u7248\uff09\u3067\u30ed\u30fc\u30ab\u30eb\u30fb\u30d6\u30c3\u30af\u30de\u30fc\u30af\u6a5f\u80fd\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11338,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,249,248],"tags":[200],"class_list":["post-11322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-react-js","category-tailwind-css","category-vite","tag-webassembly"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11322"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11322\/revisions"}],"predecessor-version":[{"id":11339,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11322\/revisions\/11339"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11338"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}