{"id":410341,"date":"2024-06-29T21:19:48","date_gmt":"2024-06-29T21:19:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=410341"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=410341","title":{"rendered":"<span>SQLite-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0427\u0435\u0433\u043e \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e, \u0442\u0430\u043a \u044d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 JSFiddle \u0434\u043b\u044f SQLite. \u041e\u043d\u043b\u0430\u0439\u043d-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c SQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438.<\/p>\n<p>\u0412\u043e\u0442 \u0447\u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443, \u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c SQL \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0430\u0437\u044b, \u0442\u0430\u043a \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 (\u043f\u043e url).<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u0435\u0436\u0430\u0439\u0448\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SQLite.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0441\u0430\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f66\/6ab\/789\/f666ab789703609e6707ddd5bcd4f2a7.png\" alt=\"\u0420\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" title=\"\u0420\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\" width=\"2024\" height=\"1488\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f66\/6ab\/789\/f666ab789703609e6707ddd5bcd4f2a7.png\"\/><figcaption>\u0420\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043a\u0430\u0436\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u043e\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/sqlime.org\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043a\u0430<\/a> \u0441 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/sqlime.org\/#gist:e012594111ce51f91590c4737e41a046\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/nalgeon\/sqlime\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>SQLite \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/h3>\n<p>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u2014 \u0447\u0442\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445, \u0447\u0442\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u0445 \u2014 \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 SQL-92 (\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0441\u043e\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432) \u2014 <a href=\"https:\/\/sqlite.org\/\" rel=\"noopener noreferrer nofollow\">SQLite<\/a>. \u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u0430\u0442\u044c \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0447\u0435\u0440\u0435\u0437 API \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0435 \u0432\u0435\u043d\u0434\u043e\u0440\u044b \u0442\u0430\u043a \u0434\u0443\u043c\u0430\u043b\u0438. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 Web SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043b\u0438 Apple (Safari), Google (Chrome) \u0438 Opera (\u0435\u0449\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0442\u043e\u0433\u0434\u0430). \u0410 Mozilla (Firefox) \u2014 \u043d\u0435\u0442. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 2010 Web SQL \u0443\u0431\u0438\u043b\u0438, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u0448\u043b\u043e \u043f\u043e NoSQL-\u043f\u0443\u0442\u0438 (Indexed Database, Cache API).<\/p>\n<p>\u0412 2019 \u0433\u043e\u0434\u0443 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/sql-js\/sql.js\" rel=\"noopener noreferrer nofollow\">sql.js<\/a> \u041e\u0444\u0438\u0440 \u041b\u043e\u0436\u043a\u0438\u043d \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 SQLite \u0432 WebAssembly (\u00ab\u0440\u043e\u0434\u043d\u043e\u0439\u00bb\u00a0\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430). \u042d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0421\u0423\u0411\u0414 SQLite, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (\u0431\u043b\u0430\u0433\u043e, \u043e\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u2014\u00a0\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 300+ \u041a\u0431).<\/p>\n<p>sql.js \u2014\u00a0\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b. \u0415\u0433\u043e \u044f \u0438 \u0432\u0437\u044f\u043b.<\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0430\u0437\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<\/h3>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 <code>input[type=file]<\/code>, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>FileReader<\/code>, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 8-\u0431\u0438\u0442\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 SQLite:<\/p>\n<pre><code class=\"javascript\">const file = event.target.files[0]; const reader = new FileReader(); reader.onload = function () {     const arr = new Uint8Array(reader.result);     return new SQL.Database(arr); }; reader.readAsArrayBuffer(file);<\/code><\/pre>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0430\u0437\u044b \u043f\u043e URL<\/h3>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fetch()<\/code>, \u043d\u0430\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 <code>ArrayBuffer<\/code>, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">const resp = await fetch(url); const buffer = await response.arrayBuffer(); const arr = new Uint8Array(buffer); return new SQL.Database(arr);<\/code><\/pre>\n<p>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 URL. \u0423\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0431\u0430\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0441\u0442\u044f\u0442\u0441\u044f \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u2014\u00a0\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d <code>raw.githubusercontent.com<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>github.com<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>https:\/\/github.com\/nalgeon\/sqliter\/blob\/main\/employees.db \u2192 https:\/\/raw.githubusercontent.com\/nalgeon\/sqliter\/main\/employees.db<\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435<\/h3>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 sql.js \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 API \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \/\/ \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 const result = db.exec(sql); if (!result.length) {     return null; } return result[result.length - 1];<\/code><\/pre>\n<h3>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0431\u0430\u0437\u044b \u0432 SQL-\u0441\u043a\u0440\u0438\u043f\u0442<\/h3>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u0430\u0437\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u2014\u00a0sql.js \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const buffer = db.export(); const blob = new Blob([buffer]); const link = document.createElement(\"a\"); link.href = window.URL.createObjectURL(blob); \/\/ ... link.click();<\/code><\/pre>\n<p>\u041d\u043e \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u0430 \u043f\u043e\u043b\u043d\u044b\u0439 SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0445\u0435\u043c\u0443 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0422\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 PostgreSQL \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0421\u0423\u0411\u0414.<\/p>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0432 SQL \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043f\u0438\u0442\u043e\u043d\u044f\u0447\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/github.com\/simonw\/sqlite-dump\" rel=\"noopener noreferrer nofollow\">sqlite-dump<\/a>. \u041a\u043e\u0434 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c (\u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 <a href=\"https:\/\/github.com\/nalgeon\/sqlime\/blob\/main\/js\/dumper.js\" rel=\"noopener noreferrer nofollow\">dumper.js<\/a>). \u0412\u043a\u0440\u0430\u0442\u0446\u0435:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>sqlite_schema<\/code>, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b <code>create table...<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>table_info(name)<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b <code>insert into...<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"sql\">CREATE TABLE IF NOT EXISTS employees (     id integer primary key,     name text,     city text,     department text,     salary integer ); INSERT INTO \"employees\" VALUES(11,'\u0414\u0430\u0440\u044c\u044f','\u0421\u0430\u043c\u0430\u0440\u0430','hr',70); INSERT INTO \"employees\" VALUES(12,'\u0411\u043e\u0440\u0438\u0441','\u0421\u0430\u043c\u0430\u0440\u0430','hr',78); INSERT INTO \"employees\" VALUES(21,'\u0415\u043b\u0435\u043d\u0430','\u0421\u0430\u043c\u0430\u0440\u0430','it',84); ...<\/code><\/pre>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435<\/h3>\n<p>\u0411\u0430\u0437\u0443 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443. \u041c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u0438\u043b\u0438\u0442\u044c \u0431\u0435\u043a\u0435\u043d\u0434 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u2014 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u043d\u044b\u043c, \u0434\u0430 \u0438 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043b\u0438\u0448\u043d\u044f\u044f \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.github.com\/en\/rest\/reference\/gists\" rel=\"noopener noreferrer nofollow\">GitHub Gist API<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d CORS (\u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>fetch()<\/code>: GET \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0433\u0438\u0441\u0442\u0430, POST \u043d\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c SQL-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b const data = export(db); \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0432\u0438\u0434\u0435 \u0433\u0438\u0441\u0442\u0430 fetch(\"https:\/\/api.github.com\/gists\", {     method: \"post\",     headers: {         Accept: \"application\/json\",         \"Content-Type\": \"application\/json\",         Authorization: `Token ${token}`     },     body: JSON.stringify(data), });<\/code><\/pre>\n<p>\u041e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0438\u0442\u0445\u0430\u0431\u043e\u0432\u0441\u043a\u0438\u0439 API-\u0442\u043e\u043a\u0435\u043d. \u0423\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u0442\u043e\u043a\u0435\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0433\u0438\u0441\u0442\u0430\u043c\u0438 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/h3>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u0443\u043b\u0438\u043d\u0433\u043e\u043c \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0448\u0442\u0443\u043a\u0430\u043c\u0438, \u0430 \u043c\u043d\u0435 \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e (\u044f \u043d\u0435 js-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u0435 \u043d\u0430 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c html + css + js. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/103\/400\/6a9\/1034006a95f6c2775cd3c1b508dfb610.png\" alt=\"\u041f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0441\u044f \u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u2014 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0410 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.\" title=\"\u041f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0441\u044f \u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u2014 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0410 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.\" width=\"1153\" height=\"1200\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/103\/400\/6a9\/1034006a95f6c2775cd3c1b508dfb610.png\"\/><figcaption>\u041f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0441\u044f \u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u2014 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0410 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/figcaption><\/figure>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c js-\u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0438 \u0432\u0435\u0431-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u2014 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440 \u043f\u043e\u043c\u043e\u0440\u0449\u0438\u0442\u0441\u044f, \u043d\u043e \u043c\u043d\u0435 \u043d\u043e\u0440\u043c.<\/p>\n<p>\u0425\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043d\u0430 <a href=\"https:\/\/pages.github.com\/\" rel=\"noopener noreferrer nofollow\">GitHub Pages<\/a>, \u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 <code>git push<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0435\u0442, \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0430\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c GitHub Actions.<\/p>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0435<\/h3>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 <a href=\"https:\/\/sqlime.org\/\" rel=\"noopener noreferrer nofollow\">SQLite-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a> \u0432\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0418\u043b\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0441\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 JS + GitHub API. \u0417\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u30c4<\/p>\n<p><em>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SQLite \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043a\u0430\u043d\u0430\u043b <\/em><a href=\"https:\/\/t.me\/sqliter\" rel=\"noopener noreferrer nofollow\"><em>@sqliter<\/em><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/580240\/\"> https:\/\/habr.com\/ru\/articles\/580240\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0427\u0435\u0433\u043e \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e, \u0442\u0430\u043a \u044d\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0430 JSFiddle \u0434\u043b\u044f SQLite. \u041e\u043d\u043b\u0430\u0439\u043d-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c SQL-\u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438.<\/p>\n<p>\u0412\u043e\u0442 \u0447\u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443, \u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c SQL \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u0430\u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0430\u0437\u044b, \u0442\u0430\u043a \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 (\u043f\u043e url).<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0432\u0435\u0436\u0430\u0439\u0448\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f SQLite.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0437\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u0442\u0430\u043a\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0441\u0430\u043c.<\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043a\u0430\u0436\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043f\u043e\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/sqlime.org\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043a\u0430<\/a> \u0441 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/sqlime.org\/#gist:e012594111ce51f91590c4737e41a046\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/nalgeon\/sqlime\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h3>SQLite \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/h3>\n<p>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 \u2014 \u0447\u0442\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445, \u0447\u0442\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u0445 \u2014 \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0421\u0423\u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 SQL-92 (\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u0443\u0441\u043e\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u0432) \u2014 <a href=\"https:\/\/sqlite.org\/\" rel=\"noopener noreferrer nofollow\">SQLite<\/a>. \u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0434\u0430\u0442\u044c \u043a \u043d\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0447\u0435\u0440\u0435\u0437 API \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0435 \u0432\u0435\u043d\u0434\u043e\u0440\u044b \u0442\u0430\u043a \u0434\u0443\u043c\u0430\u043b\u0438. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 Web SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043b\u0438 Apple (Safari), Google (Chrome) \u0438 Opera (\u0435\u0449\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0442\u043e\u0433\u0434\u0430). \u0410 Mozilla (Firefox) \u2014 \u043d\u0435\u0442. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 2010 Web SQL \u0443\u0431\u0438\u043b\u0438, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u0448\u043b\u043e \u043f\u043e NoSQL-\u043f\u0443\u0442\u0438 (Indexed Database, Cache API).<\/p>\n<p>\u0412 2019 \u0433\u043e\u0434\u0443 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/sql-js\/sql.js\" rel=\"noopener noreferrer nofollow\">sql.js<\/a> \u041e\u0444\u0438\u0440 \u041b\u043e\u0436\u043a\u0438\u043d \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 SQLite \u0432 WebAssembly (\u00ab\u0440\u043e\u0434\u043d\u043e\u0439\u00bb\u00a0\u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430). \u042d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f \u0421\u0423\u0411\u0414 SQLite, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (\u0431\u043b\u0430\u0433\u043e, \u043e\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u2014\u00a0\u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 300+ \u041a\u0431).<\/p>\n<p>sql.js \u2014\u00a0\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0432\u0438\u0436\u043e\u043a \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u044b. \u0415\u0433\u043e \u044f \u0438 \u0432\u0437\u044f\u043b.<\/p>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0430\u0437\u044b \u0438\u0437 \u0444\u0430\u0439\u043b\u0430<\/h3>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 <code>input[type=file]<\/code>, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>FileReader<\/code>, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0432 8-\u0431\u0438\u0442\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 SQLite:<\/p>\n<pre><code class=\"javascript\">const file = event.target.files[0]; const reader = new FileReader(); reader.onload = function () {     const arr = new Uint8Array(reader.result);     return new SQL.Database(arr); }; reader.readAsArrayBuffer(file);<\/code><\/pre>\n<h3>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0430\u0437\u044b \u043f\u043e URL<\/h3>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fetch()<\/code>, \u043d\u0430\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 <code>ArrayBuffer<\/code>, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">const resp = await fetch(url); const buffer = await response.arrayBuffer(); const arr = new Uint8Array(buffer); return new SQL.Database(arr);<\/code><\/pre>\n<p>\u041e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u043c\u0438 URL. \u0423\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0431\u0430\u0437\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0441\u0442\u044f\u0442\u0441\u044f \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u2014\u00a0\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d <code>raw.githubusercontent.com<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>github.com<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>https:\/\/github.com\/nalgeon\/sqliter\/blob\/main\/employees.db \u2192 https:\/\/raw.githubusercontent.com\/nalgeon\/sqliter\/main\/employees.db<\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435<\/h3>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 sql.js \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 API \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \/\/ \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 const result = db.exec(sql); if (!result.length) {     return null; } return result[result.length - 1];<\/code><\/pre>\n<h3>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0431\u0430\u0437\u044b \u0432 SQL-\u0441\u043a\u0440\u0438\u043f\u0442<\/h3>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0431\u0430\u0437\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u2014\u00a0sql.js \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">const buffer = db.export(); const blob = new Blob([buffer]); const link = document.createElement(\"a\"); link.href = window.URL.createObjectURL(blob); \/\/ ... link.click();<\/code><\/pre>\n<p>\u041d\u043e \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043d\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a, \u0430 \u043f\u043e\u043b\u043d\u044b\u0439 SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0445\u0435\u043c\u0443 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0422\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 PostgreSQL \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0443\u044e \u0421\u0423\u0411\u0414.<\/p>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0432 SQL \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043f\u0438\u0442\u043e\u043d\u044f\u0447\u0435\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/github.com\/simonw\/sqlite-dump\" rel=\"noopener noreferrer nofollow\">sqlite-dump<\/a>. \u041a\u043e\u0434 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c (\u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 <a href=\"https:\/\/github.com\/nalgeon\/sqlime\/blob\/main\/js\/dumper.js\" rel=\"noopener noreferrer nofollow\">dumper.js<\/a>). \u0412\u043a\u0440\u0430\u0442\u0446\u0435:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>sqlite_schema<\/code>, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b <code>create table...<\/code><\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>table_info(name)<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b <code>insert into...<\/code><\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"sql\">CREATE TABLE IF NOT EXISTS employees (     id integer primary key,     name text,     city text,     department text,     salary integer ); INSERT INTO \"employees\" VALUES(11,'\u0414\u0430\u0440\u044c\u044f','\u0421\u0430\u043c\u0430\u0440\u0430','hr',70); INSERT INTO \"employees\" VALUES(12,'\u0411\u043e\u0440\u0438\u0441','\u0421\u0430\u043c\u0430\u0440\u0430','hr',78); INSERT INTO \"employees\" VALUES(21,'\u0415\u043b\u0435\u043d\u0430','\u0421\u0430\u043c\u0430\u0440\u0430','it',84); ...<\/code><\/pre>\n<h3>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435<\/h3>\n<p>\u0411\u0430\u0437\u0443 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0443\u0436\u043d\u043e \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443. \u041c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u0438\u043b\u0438\u0442\u044c \u0431\u0435\u043a\u0435\u043d\u0434 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u2014 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043b\u0430\u0442\u043d\u044b\u043c, \u0434\u0430 \u0438 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043b\u0438\u0448\u043d\u044f\u044f \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.github.com\/en\/rest\/reference\/gists\" rel=\"noopener noreferrer nofollow\">GitHub Gist API<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d CORS (\u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432);<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>fetch()<\/code>: GET \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0433\u0438\u0441\u0442\u0430, POST \u043d\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"javascript\">\/\/ \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c SQL-\u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b const data = export(db); \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0432\u0438\u0434\u0435 \u0433\u0438\u0441\u0442\u0430 fetch(\"https:\/\/api.github.com\/gists\", {     method: \"post\",     headers: {         Accept: \"application\/json\",         \"Content-Type\": \"application\/json\",         Authorization: `Token ${token}`     },     body: JSON.stringify(data), });<\/code><\/pre>\n<p>\u041e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0438\u0442\u0445\u0430\u0431\u043e\u0432\u0441\u043a\u0438\u0439 API-\u0442\u043e\u043a\u0435\u043d. \u0423\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u0442\u043e\u043a\u0435\u043d\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0433\u0438\u0441\u0442\u0430\u043c\u0438 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043b\u043e\u0445\u043e\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 \u043f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0442\u043e\u043a\u0435\u043d\u0443 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<h3>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/h3>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u0443\u043b\u0438\u043d\u0433\u043e\u043c \u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u043c\u0438 \u0448\u0442\u0443\u043a\u0430\u043c\u0438, \u0430 \u043c\u043d\u0435 \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e (\u044f \u043d\u0435 js-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c UI-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u0435 \u043d\u0430 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c html + css + js. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e.<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043b\u0441\u044f \u043e \u0432\u0435\u0440\u0441\u0442\u043a\u0435 \u043f\u043e\u0434 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u2014 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. \u0410 \u043d\u0430 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0448\u043e\u0440\u0442\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/figcaption><\/figure>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c js-\u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0438 \u0432\u0435\u0431-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u2014 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0435\u0440 \u043f\u043e\u043c\u043e\u0440\u0449\u0438\u0442\u0441\u044f, \u043d\u043e \u043c\u043d\u0435 \u043d\u043e\u0440\u043c.<\/p>\n<p>\u0425\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430 \u043d\u0430 <a href=\"https:\/\/pages.github.com\/\" rel=\"noopener noreferrer nofollow\">GitHub Pages<\/a>, \u0430 \u0434\u0435\u043f\u043b\u043e\u0439 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u043c\u0443 <code>git push<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430\u043f\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0435\u0442, \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0430\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c GitHub Actions.<\/p>\n<h3>\u0420\u0435\u0437\u044e\u043c\u0435<\/h3>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 <a href=\"https:\/\/sqlime.org\/\" rel=\"noopener noreferrer nofollow\">SQLite-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a> \u0432\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0418\u043b\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0441\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 JS + GitHub API. \u0417\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u30c4<\/p>\n<p><em>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c SQLite \u043d\u0430 \u043f\u043e\u043b\u043d\u0443\u044e \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043a\u0430\u043d\u0430\u043b <\/em><a href=\"https:\/\/t.me\/sqliter\" rel=\"noopener noreferrer nofollow\"><em>@sqliter<\/em><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/580240\/\"> https:\/\/habr.com\/ru\/articles\/580240\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-410341","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=410341"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/410341\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=410341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=410341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=410341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}