File tree Expand file tree Collapse file tree 5 files changed +34
-4
lines changed Expand file tree Collapse file tree 5 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ var dbFileElm = document.getElementById('dbfile');
6
6
var savedbElm = document . getElementById ( 'savedb' ) ;
7
7
8
8
// Start the worker in which sql.js will run
9
- var worker = new Worker ( "/dist/worker.sql-wasm.js" ) ;
9
+ var worker = new Worker ( "../.. /dist/worker.sql-wasm.js" ) ;
10
10
worker . onerror = error ;
11
11
12
12
// Open a database
Original file line number Diff line number Diff line change 3
3
< head >
4
4
< meta charset ="utf8 ">
5
5
< title > Persistent sqlite</ title >
6
- < script src ="/dist/sql-wasm.js "> </ script >
6
+ < script src =".. /dist/sql-wasm.js "> </ script >
7
7
</ head >
8
8
< body >
9
9
< p > You have seen this page < span id ="views "> 0</ span > times.</ p >
10
10
< div >
11
11
You have been here on the following dates: < ol id ="dates "> </ ol >
12
12
</ div >
13
13
< script >
14
+ var baseUrl = '../dist/' ;
14
15
15
16
function toBinArray ( str ) {
16
17
var l = str . length ,
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ < html >
3
+ <!--Simple Read eval print loop for SQL-->
4
+ < head >
5
+ < meta charset ="utf8 ">
6
+ < title > SQL REPL</ title >
7
+ < script src ="../js/sql.js "> </ script >
8
+ </ head >
9
+ < body >
10
+ < input type ='text ' id ='input ' placeholder ="ENTER SOME SQL " size ='50 '
11
+ value ="CREATE TABLE test(val);INSERT INTO test VALUES (666); SELECT * FROM test ">
12
+ < button id ='submit '> Execute</ button >
13
+ < pre id ='result '> </ pre >
14
+ < pre id ='error '> </ pre >
15
+ < script >
16
+
17
+ //Open a blank database
18
+ var db = new SQL . Database ( ) ;
19
+
20
+ document . getElementById ( 'submit' ) . onclick = function ( ) {
21
+ var sql = document . getElementById ( 'input' ) . value ;
22
+ var result = '' , error = '' ;
23
+ try { result = db . exec ( sql ) ; }
24
+ catch ( e ) { error = e ; }
25
+ document . getElementById ( 'result' ) . innerHTML = JSON . stringify ( result , null , ' ' ) ;
26
+ document . getElementById ( 'error' ) . innerHTML = error ;
27
+ } ;
28
+ </ script >
29
+ </ body >
Original file line number Diff line number Diff line change 3
3
< script src ='http://requirejs.org/docs/release/2.3.6/minified/require.js '> </ script >
4
4
5
5
< script >
6
- var baseUrl = '/dist'
6
+ var baseUrl = '.. /dist'
7
7
require . config ( {
8
8
baseUrl : baseUrl
9
9
} ) ;
Original file line number Diff line number Diff line change 1
1
< meta charset ="utf8 " />
2
2
< html >
3
- < script src ='/dist/sql-wasm-debug.js '> </ script >
3
+ < script src ='../.. /dist/sql-wasm-debug.js '> </ script >
4
4
< script >
5
5
config = {
6
6
locateFile : ( filename , prefix ) => {
You can’t perform that action at this time.
0 commit comments