Skip to content

Commit 64d6669

Browse files
committed
fix repl example
1 parent a900f7b commit 64d6669

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

examples/repl.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="utf8">
66
<title>SQL REPL</title>
7-
<script src="../js/sql.js"></script>
7+
<script src="../dist/sql-wasm.js"></script>
88
</head>
99
<body>
1010
<input type='text' id='input' placeholder="ENTER SOME SQL" size='50'
@@ -15,7 +15,10 @@
1515
<script>
1616

1717
//Open a blank database
18-
var db = new SQL.Database();
18+
var db;
19+
initSqlJs({ locateFile: filename => `../dist/${filename}` }).then(function(SQL){
20+
db = new SQL.Database();
21+
});
1922

2023
document.getElementById('submit').onclick = function(){
2124
var sql = document.getElementById('input').value;

examples/simple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<meta charset="utf8" />
22
<html>
3-
<script src='../../dist/sql-wasm-debug.js'></script>
3+
<script src='../dist/sql-wasm-debug.js'></script>
44
<script>
55
config = {
66
locateFile: (filename, prefix) => {

index.html

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ <h2>Examples</h2>
1111

1212
<ol>
1313
<li><a href="./examples/GUI">Online SQL Interpreter</a> Full featured Sqlite Interpreter running in your browser.</li>
14+
<li><a href="./examples/repl.html">Online SQL read eval print loop</a> simple SQLite REPL </li>
1415
<li><a href="./examples/persistent.html">Persistence</a> Persisting data</li>
1516
<li><a href="./examples/requireJS.html">RequireJS</a> Load sql.js asynchronously using <a href="https://requirejs.org/">RequireJs</a></li>
1617
<li><a href="./examples/simple.html">Simple Example</a> Demonstrates prepare,getAsObject, and other SQL.js methods. </li>

0 commit comments

Comments
 (0)