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

Lines changed: 5 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy