Conversation
|
@eSlider, this is a nice PR, why did you close it ? |
| const me = this; | ||
| Promise.all([initSqlJs(), axios.get('./test.db', {responseType: 'arraybuffer'})]).then(res => { | ||
| const SQLite = res[0], dbStorage = res[1]; | ||
| const db = new SQLite.Database(new Uint8Array(dbStorage.data)); | ||
| // language=SQLite | ||
| // const rows = db.exec("SELECT count(*) FROM db_articles"); | ||
| // console.log(rows); | ||
| me.setState({db: db}); | ||
|
|
||
| }).catch(err => { | ||
| me.setState({err}); | ||
| }); |
There was a problem hiding this comment.
| const me = this; | |
| Promise.all([initSqlJs(), axios.get('./test.db', {responseType: 'arraybuffer'})]).then(res => { | |
| const SQLite = res[0], dbStorage = res[1]; | |
| const db = new SQLite.Database(new Uint8Array(dbStorage.data)); | |
| // language=SQLite | |
| // const rows = db.exec("SELECT count(*) FROM db_articles"); | |
| // console.log(rows); | |
| me.setState({db: db}); | |
| }).catch(err => { | |
| me.setState({err}); | |
| }); | |
| Promise.all([ | |
| initSqlJs(), | |
| fetch('test.db', {responseType: 'arraybuffer'}) | |
| ]).then(([SQLite, dbStorage]) => { | |
| this.setState({db: new SQLite.Database(new Uint8Array(dbStorage.data))}); | |
| }).catch(err => { | |
| this.setState({err}); | |
| }); |
There was a problem hiding this comment.
@lovasoa, thank you for the advise to use fetch. I will use it.
| onChange={e => this.exec(e.target.value)} | ||
| placeholder="Enter some SQL. No inpiration ? Try “select sqlite_version()”" | ||
| ></textarea> | ||
| >SELECT count(*) FROM db_articles</textarea> |
There was a problem hiding this comment.
| >SELECT count(*) FROM db_articles</textarea> | |
| SELECT * FROM db_articles |
| @@ -1,8 +1,8 @@ | |||
| import React from "react"; | |||
| import axios from "axios"; | |||
There was a problem hiding this comment.
| import axios from "axios"; |
| <link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | ||
| <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | ||
| <!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json">--> | ||
| <!-- <link rel="shortcut icon" href="%PUBLIC_URL%/fav/favicon.ico">--> |
There was a problem hiding this comment.
| <link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | |
| <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | |
| <!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json">--> | |
| <!-- <link rel="shortcut icon" href="%PUBLIC_URL%/fav/favicon.ico">--> | |
| <link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | |
| <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> |
There was a problem hiding this comment.
Ooops 😁 You are right, there is no manifest, let's remove this line.
| "main": "src/index.js", | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "axios": "^0.19.2", |
There was a problem hiding this comment.
| "axios": "^0.19.2", |
There was a problem hiding this comment.
@eSlider, this is a nice PR, why did you close it ?
@lovasoa, it's breaks previous behavior.
Here are the changes:
- Download an sqlite database file (axios)
- Prepare downloaded file to handle it right (that was not easy :)
- Add favicon to prevent 404 errors
- Remove load of
manifest.json- that not exists - Lock packages to get working version
- Add an select SQL query as a value for textearea
- Publish to another place: link
- Circle CI:
If you ok with, I will open PR again.
P.S. And thank you so much for you simple react-boilerplate! It's amazing!
There was a problem hiding this comment.
Hello !
Download an sqlite database file (axios)
You don't need to add a dependency just to make an HTTP request. Let's just use fetch
Prepare downloaded file to handle it right (that was not easy :)
?
Add favicon to prevent 404 errors
✔️
Lock packages to get working version
✔️
Add an select SQL query as a value for textearea
✔️
Publish to another place: link
Circle CI:
Automated static content build
Publish build in a gh-pages branch
Disable jekyll post processing
Prepare demo to work over github pages CDN
Get load generated assets using relative paths (That what I am working on)
Let's just keep the current netlify CD (https://sqljs-react-demo.netlify.com/). I don't think we need to switch to github pages.
|
I highlighted a few suggested changes |
No description provided.