494 lines
18 KiB
HTML
494 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>在线演示 — MetonaSqlark v0.1.14</title>
|
|
<style>
|
|
:root {
|
|
--bg:#0a0a0f; --surface:#0d1117; --surface2:#161b22; --border:#30363d;
|
|
--primary:#6366f1; --accent:#06b6d4; --accent2:#ec4899; --green:#22c55e;
|
|
--text:#e2e8f0; --text2:#8b949e; --radius:12px;
|
|
--gradient:linear-gradient(135deg,#6366f1,#06b6d4,#ec4899);
|
|
}
|
|
* { margin:0; padding:0; box-sizing:border-box; }
|
|
body { font-family:'Inter',-apple-system,system-ui,sans-serif; background:var(--bg); color:var(--text); height:100vh; overflow:hidden; }
|
|
header {
|
|
height:56px; display:flex; align-items:center; justify-content:space-between; padding:0 24px;
|
|
background:var(--surface); border-bottom:1px solid var(--border); z-index:10; position:relative;
|
|
}
|
|
.logo { font-weight:800; font-size:1.1rem; display:flex; align-items:center; gap:10px; }
|
|
.logo .icon { width:28px; height:28px; border-radius:7px; background:var(--gradient); display:flex; align-items:center; justify-content:center; font-size:0.85rem; font-weight:900; color:#fff; }
|
|
.logo span { background:var(--gradient); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
|
|
nav { display:flex; gap:20px; }
|
|
nav a { color:var(--text2); text-decoration:none; font-size:0.88rem; transition:.2s; }
|
|
nav a:hover,.nav-active { color:var(--text); }
|
|
.status { display:flex; align-items:center; gap:8px; font-size:0.82rem; color:var(--text2); }
|
|
.status .dot { width:7px; height:7px; border-radius:50%; background:var(--green); animation:pulse 2s infinite; }
|
|
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
|
|
.main { display:flex; height:calc(100vh - 56px); }
|
|
.editor-panel { flex:1; display:flex; flex-direction:column; border-right:1px solid var(--border); min-width:400px; }
|
|
.result-panel { flex:1; display:flex; flex-direction:column; min-width:400px; }
|
|
.panel-header {
|
|
padding:12px 20px; font-size:0.78rem; font-weight:600; text-transform:uppercase;
|
|
letter-spacing:1px; color:var(--text2); border-bottom:1px solid var(--border);
|
|
display:flex; align-items:center; justify-content:space-between;
|
|
}
|
|
.panel-header .badge {
|
|
font-size:0.7rem; padding:3px 10px; border-radius:999px; background:var(--surface2);
|
|
border:1px solid var(--border); text-transform:none; letter-spacing:0;
|
|
}
|
|
.editor-area { flex:1; display:flex; flex-direction:column; }
|
|
#sql-input {
|
|
flex:1; background:var(--surface); color:var(--text); border:none; padding:20px;
|
|
font-family:'JetBrains Mono','Fira Code',monospace; font-size:0.9rem; line-height:1.8;
|
|
resize:none; outline:none; caret-color:var(--primary);
|
|
}
|
|
#sql-input::placeholder { color:var(--text2); opacity:0.5; }
|
|
.toolbar { display:flex; gap:8px; padding:12px 20px; border-top:1px solid var(--border); background:var(--surface2); flex-wrap:wrap; }
|
|
.btn {
|
|
display:inline-flex; align-items:center; gap:6px; padding:10px 20px; border-radius:8px;
|
|
font-weight:600; font-size:0.85rem; cursor:pointer; border:none; transition:.25s; font-family:inherit;
|
|
}
|
|
.btn-run { background:var(--gradient); color:#fff; box-shadow:0 4px 15px rgba(99,102,241,0.35); }
|
|
.btn-run:hover { transform:translateY(-1px); box-shadow:0 6px 25px rgba(99,102,241,0.5); }
|
|
.btn-run:active { transform:scale(0.97); }
|
|
.btn-clear { background:var(--surface2); color:var(--text2); border:1px solid var(--border); }
|
|
.btn-clear:hover { color:var(--text); border-color:var(--text2); }
|
|
.btn-preset { background:transparent; color:var(--accent); border:1px solid var(--accent); font-size:0.78rem; padding:6px 14px; }
|
|
.btn-preset:hover { background:rgba(6,182,212,0.12); }
|
|
.result-content { flex:1; overflow-y:auto; padding:20px; }
|
|
.result-table { width:100%; border-collapse:collapse; font-size:0.85rem; }
|
|
.result-table th { text-align:left; padding:10px 14px; background:var(--surface2); color:var(--accent); font-weight:600; border-bottom:2px solid var(--border); position:sticky; top:0; z-index:1; }
|
|
.result-table td { padding:8px 14px; border-bottom:1px solid var(--border); color:var(--text2); max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
.result-table tr:hover td { background:rgba(99,102,241,0.04); }
|
|
.empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; color:var(--text2); gap:12px; }
|
|
.empty-state .icon { font-size:3rem; opacity:0.3; }
|
|
.error-box { background:rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.3); border-radius:10px; padding:16px; color:#f87171; font-family:'JetBrains Mono',monospace; font-size:0.82rem; margin-bottom:16px; }
|
|
.success-box { background:rgba(34,197,94,0.1); border:1px solid rgba(34,197,94,0.3); border-radius:10px; padding:12px 16px; color:#4ade80; font-size:0.85rem; margin-bottom:16px; }
|
|
.sql-tag { display:inline-block; background:var(--surface2); border:1px solid var(--border); border-radius:6px; padding:4px 12px; font-family:'JetBrains Mono',monospace; font-size:0.75rem; color:var(--accent); margin-bottom:8px; }
|
|
::-webkit-scrollbar { width:6px; height:6px; }
|
|
::-webkit-scrollbar-track { background:transparent; }
|
|
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }
|
|
@media(max-width:900px){ .main { flex-direction:column; } .editor-panel,.result-panel { min-width:auto; } .editor-panel { height:50%; } }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<div class="logo"><div class="icon">◈</div><span>MetonaSqlark</span></div>
|
|
<nav>
|
|
<a href="index.html">首页</a>
|
|
<a href="docs.html">文档</a>
|
|
<a href="demo.html" class="nav-active">演示</a>
|
|
</nav>
|
|
<div class="status"><span class="dot"></span> Memory 模式 — v0.1.14</div>
|
|
</header>
|
|
|
|
<div class="main">
|
|
<div class="editor-panel">
|
|
<div class="editor-area">
|
|
<textarea id="sql-input" placeholder="输入 SQL 语句... SELECT * FROM users; INSERT INTO users VALUES ('4', 'Diana', 'diana@test.com', 28); SELECT u.name, o.amount FROM users u INNER JOIN orders o ON u.id = o.user_id;">-- 🚀 MetonaSqlark v0.1.14 在线演示
|
|
-- 已预置 users / orders / products 表数据
|
|
|
|
-- 查看所有数据
|
|
SELECT * FROM users;
|
|
|
|
-- 条件查询 + 排序
|
|
SELECT name, age FROM users WHERE age > 25 ORDER BY age DESC;
|
|
|
|
-- JOIN 多表关联
|
|
SELECT u.name, o.product, o.amount
|
|
FROM users u INNER JOIN orders o ON u.id = o.user_id;
|
|
|
|
-- 聚合统计
|
|
SELECT COUNT(*) as total_users, AVG(age) as avg_age FROM users;</textarea>
|
|
<div class="toolbar">
|
|
<button class="btn btn-run" onclick="runQuery()">▶ 执行 (Ctrl+Enter)</button>
|
|
<button class="btn btn-clear" onclick="clearResults()">🗑 清空</button>
|
|
<span style="flex:1"></span>
|
|
<button class="btn btn-preset" onclick="loadPreset('all')">📋 全数据</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('join')">🔗 JOIN</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('agg')">📊 聚合</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('ddl')">🏗 DDL</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('crud')">✏️ CRUD</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('subquery')">🔍 子查询</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('tx')">🔒 事务</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('scalar')">🎯 标量子查询</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('cascade')">🔗 级联</button>
|
|
<button class="btn btn-preset" onclick="loadPreset('adv')">🧪 高级</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="result-panel">
|
|
<div class="panel-header">
|
|
<span>📊 查询结果</span>
|
|
<span class="badge" id="row-count">0 行</span>
|
|
</div>
|
|
<div class="result-content" id="result-area">
|
|
<div class="empty-state">
|
|
<div class="icon">⚡</div>
|
|
<div>执行 SQL 查询以查看结果</div>
|
|
<div style="font-size:0.8rem;opacity:0.6">Ctrl + Enter 快捷执行 · 支持多语句</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="../dist/metona-sqlark.js"></script>
|
|
<script>
|
|
// Resolve global: try both MetonaSqlark and MeSqlark
|
|
const globalNs = window.MetonaSqlark || window.MeSqlark || {};
|
|
const { MetonaSqlark, MeSqlark, create } = globalNs;
|
|
const DBClass = MetonaSqlark || MeSqlark;
|
|
|
|
let db = null;
|
|
const resultArea = document.getElementById('result-area');
|
|
const rowCount = document.getElementById('row-count');
|
|
const sqlInput = document.getElementById('sql-input');
|
|
|
|
// Init database
|
|
async function initDB() {
|
|
try {
|
|
db = new DBClass({ name: 'demo', mode: 'memory' });
|
|
await db.init();
|
|
|
|
// Create tables
|
|
await db.defineTable('users', {
|
|
id: { type: 'string', primaryKey: true },
|
|
name: { type: 'string', required: true },
|
|
email: { type: 'string' },
|
|
age: { type: 'number', default: 0 },
|
|
});
|
|
await db.defineTable('orders', {
|
|
id: { type: 'string', primaryKey: true },
|
|
user_id: { type: 'string' },
|
|
product: { type: 'string' },
|
|
amount: { type: 'number' },
|
|
quantity: { type: 'number', default: 1 },
|
|
});
|
|
await db.defineTable('products', {
|
|
id: { type: 'string', primaryKey: true },
|
|
name: { type: 'string', required: true },
|
|
price: { type: 'number', default: 0 },
|
|
category: { type: 'string' },
|
|
});
|
|
|
|
// Seed data
|
|
await db.table('users').insertMany([
|
|
{ id: '1', name: 'Alice', email: 'alice@demo.com', age: 30 },
|
|
{ id: '2', name: 'Bob', email: 'bob@demo.com', age: 25 },
|
|
{ id: '3', name: 'Charlie', email: 'charlie@demo.com', age: 35 },
|
|
{ id: '4', name: 'Diana', email: 'diana@demo.com', age: 28 },
|
|
{ id: '5', name: 'Eve', email: 'eve@demo.com', age: 22 },
|
|
]);
|
|
await db.table('orders').insertMany([
|
|
{ id: 'o1', user_id: '1', product: 'Laptop', amount: 1200, quantity: 1 },
|
|
{ id: 'o2', user_id: '1', product: 'Mouse', amount: 50, quantity: 2 },
|
|
{ id: 'o3', user_id: '2', product: 'Keyboard', amount: 150, quantity: 1 },
|
|
{ id: 'o4', user_id: '3', product: 'Monitor', amount: 400, quantity: 1 },
|
|
{ id: 'o5', user_id: '3', product: 'Cable', amount: 20, quantity: 3 },
|
|
]);
|
|
await db.table('products').insertMany([
|
|
{ id: 'p1', name: 'Laptop', price: 1200, category: 'Electronics' },
|
|
{ id: 'p2', name: 'Mouse', price: 50, category: 'Accessories' },
|
|
{ id: 'p3', name: 'Keyboard', price: 150, category: 'Accessories' },
|
|
]);
|
|
} catch (e) {
|
|
renderError('数据库初始化失败: ' + e.message);
|
|
}
|
|
}
|
|
|
|
// Run SQL
|
|
async function runQuery() {
|
|
const sql = sqlInput.value.trim();
|
|
if (!sql || !db) return;
|
|
|
|
const statements = sql.split(';').map(s => s.trim()).filter(s => s.length > 0);
|
|
|
|
try {
|
|
const allResults = [];
|
|
for (const stmt of statements) {
|
|
const result = await db.query(stmt);
|
|
allResults.push({ sql: stmt, result });
|
|
}
|
|
|
|
if (allResults.length === 1) {
|
|
renderResult(allResults[0]);
|
|
} else {
|
|
renderAllResults(allResults);
|
|
}
|
|
} catch (e) {
|
|
renderError(e.message || String(e));
|
|
}
|
|
}
|
|
|
|
function renderResult({ sql, result }) {
|
|
if (Array.isArray(result)) {
|
|
renderTable(result);
|
|
} else {
|
|
renderSuccess(`✅ 执行成功 (影响 ${result ?? 0} 行)`);
|
|
}
|
|
}
|
|
|
|
function renderAllResults(allResults) {
|
|
let html = '';
|
|
for (const { sql, result } of allResults) {
|
|
html += `<div class="sql-tag">> ${escapeHTML(sql)}</div>`;
|
|
if (Array.isArray(result)) {
|
|
if (result.length === 0) {
|
|
html += '<div class="success-box">✅ 查询返回 0 行</div>';
|
|
} else {
|
|
html += buildTableHTML(result);
|
|
}
|
|
} else {
|
|
html += `<div class="success-box">✅ 执行成功 (影响 ${result ?? 0} 行)</div>`;
|
|
}
|
|
html += '<div style="height:12px"></div>';
|
|
}
|
|
resultArea.innerHTML = html;
|
|
updateRowCount(allResults.reduce((sum, r) => sum + (Array.isArray(r.result) ? r.result.length : 0), 0));
|
|
}
|
|
|
|
function renderTable(rows) {
|
|
if (!rows || rows.length === 0) {
|
|
resultArea.innerHTML = '<div class="success-box">✅ 查询返回 0 行</div>';
|
|
updateRowCount(0);
|
|
return;
|
|
}
|
|
resultArea.innerHTML = buildTableHTML(rows);
|
|
updateRowCount(rows.length);
|
|
}
|
|
|
|
function buildTableHTML(rows) {
|
|
const columns = Object.keys(rows[0]);
|
|
let html = '<table class="result-table"><thead><tr>';
|
|
for (const col of columns) {
|
|
html += `<th>${escapeHTML(col)}</th>`;
|
|
}
|
|
html += '</tr></thead><tbody>';
|
|
for (const row of rows) {
|
|
html += '<tr>';
|
|
for (const col of columns) {
|
|
const val = row[col];
|
|
html += `<td>${formatCell(val)}</td>`;
|
|
}
|
|
html += '</tr>';
|
|
}
|
|
html += '</tbody></table>';
|
|
return html;
|
|
}
|
|
|
|
function formatCell(val) {
|
|
if (val === null) return '<span style="color:#64748b;font-style:italic">NULL</span>';
|
|
if (val === undefined) return '<span style="color:#64748b">-</span>';
|
|
if (typeof val === 'boolean') return `<span style="color:#fbbf24">${val}</span>`;
|
|
if (typeof val === 'number') return `<span style="color:#fbbf24">${val}</span>`;
|
|
return escapeHTML(String(val));
|
|
}
|
|
|
|
function renderError(msg) {
|
|
resultArea.innerHTML = `<div class="error-box">❌ ${escapeHTML(msg)}</div>`;
|
|
updateRowCount(0);
|
|
}
|
|
|
|
function renderSuccess(msg) {
|
|
resultArea.innerHTML = `<div class="success-box">${msg}</div>`;
|
|
}
|
|
|
|
function clearResults() {
|
|
resultArea.innerHTML = `<div class="empty-state"><div class="icon">⚡</div><div>结果已清空</div></div>`;
|
|
updateRowCount(0);
|
|
}
|
|
|
|
function updateRowCount(n) { rowCount.textContent = `${n} 行`; }
|
|
function escapeHTML(str) { return String(str).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,'''); }
|
|
|
|
// Presets
|
|
const presets = {
|
|
all: `-- 查看所有数据
|
|
SELECT * FROM users;
|
|
|
|
SELECT * FROM orders;
|
|
|
|
SELECT * FROM products;`,
|
|
join: `-- INNER JOIN:用户 + 订单
|
|
SELECT u.name, o.product, o.amount, o.quantity
|
|
FROM users u
|
|
INNER JOIN orders o ON u.id = o.user_id
|
|
ORDER BY o.amount DESC;
|
|
|
|
-- LEFT JOIN:包含没有订单的用户
|
|
SELECT u.name, o.product, o.amount
|
|
FROM users u
|
|
LEFT JOIN orders o ON u.id = o.user_id;`,
|
|
agg: `-- 聚合统计:每个用户的消费
|
|
SELECT u.name, COUNT(*) as orders, SUM(o.amount) as total_spent
|
|
FROM users u
|
|
INNER JOIN orders o ON u.id = o.user_id
|
|
GROUP BY u.name
|
|
ORDER BY total_spent DESC;
|
|
|
|
-- 全局聚合
|
|
SELECT COUNT(*) as total_users, AVG(age) as avg_age,
|
|
MIN(age) as min_age, MAX(age) as max_age
|
|
FROM users;
|
|
|
|
-- 分类统计
|
|
SELECT category, COUNT(*) as product_count, AVG(price) as avg_price
|
|
FROM products
|
|
GROUP BY category;`,
|
|
ddl: `-- 查看所有表
|
|
-- (使用 db.getTableNames() 替代)
|
|
|
|
-- 创建新表
|
|
CREATE TABLE tasks (
|
|
id STRING PRIMARY KEY,
|
|
title STRING NOT NULL,
|
|
done BOOLEAN DEFAULT false,
|
|
priority NUMBER DEFAULT 0
|
|
);
|
|
|
|
-- 插入数据
|
|
INSERT INTO tasks (id, title, done, priority) VALUES ('t1', 'Learn SQLark', false, 1);
|
|
INSERT INTO tasks VALUES ('t2', 'Write docs', true, 2);
|
|
|
|
-- 查询
|
|
SELECT * FROM tasks ORDER BY priority DESC;
|
|
|
|
-- 删除表
|
|
DROP TABLE tasks;`,
|
|
crud: `-- 增
|
|
INSERT INTO users VALUES ('9', 'Frank', 'frank@demo.com', 40);
|
|
|
|
-- 查
|
|
SELECT * FROM users WHERE name = 'Frank';
|
|
|
|
-- 改
|
|
UPDATE users SET age = 41, email = 'frank2@demo.com' WHERE id = '9';
|
|
|
|
-- 查(确认)
|
|
SELECT * FROM users WHERE id = '9';
|
|
|
|
-- 删
|
|
DELETE FROM users WHERE id = '9';
|
|
|
|
-- 确认
|
|
SELECT COUNT(*) as user_count FROM users;`,
|
|
subquery: `-- IN 子查询:有订单的用户
|
|
SELECT name, email FROM users
|
|
WHERE id IN (SELECT user_id FROM orders);
|
|
|
|
-- NOT IN 子查询:没有订单的用户
|
|
SELECT name, email FROM users
|
|
WHERE id NOT IN (SELECT user_id FROM orders);
|
|
|
|
-- 标量子查询:消费最高的用户
|
|
SELECT name, age FROM users
|
|
WHERE id IN (
|
|
SELECT user_id FROM orders
|
|
WHERE amount = (SELECT MAX(amount) FROM orders)
|
|
);`,
|
|
tx: `-- 事务:插入用户及其订单(全部成功才提交)
|
|
-- 使用 db.transaction() API(这里有演示限制)
|
|
|
|
-- 模拟事务场景:先查余额,再插入订单
|
|
SELECT * FROM users WHERE id = '1';
|
|
|
|
INSERT INTO orders VALUES ('o99', '1', 'Headphones', 199, 1);
|
|
|
|
SELECT u.name, COUNT(*) as order_count, SUM(o.amount) as total
|
|
FROM users u INNER JOIN orders o ON u.id = o.user_id
|
|
WHERE u.id = '1'
|
|
GROUP BY u.name;
|
|
|
|
-- 回滚演示:记得用 db.transaction() 包裹哦`,
|
|
scalar: `-- 聚合无 GROUP BY → 单行结果
|
|
SELECT COUNT(*) as total_users, AVG(age) as avg_age FROM users;
|
|
|
|
-- 年龄大于平均值的用户(标量子查询)
|
|
SELECT name, age FROM users
|
|
WHERE age > (SELECT AVG(age) FROM users);
|
|
|
|
-- 消费超过平均值的用户
|
|
SELECT u.name, SUM(o.amount) as spent
|
|
FROM users u INNER JOIN orders o ON u.id = o.user_id
|
|
GROUP BY u.name
|
|
HAVING SUM(o.amount) > (SELECT AVG(amount) FROM orders);`,
|
|
cascade: `-- 外键级联:先创建带外键的表
|
|
DROP TABLE IF EXISTS orders;
|
|
|
|
CREATE TABLE orders (
|
|
id STRING PRIMARY KEY,
|
|
user_id STRING REFERENCES users(id) ON DELETE CASCADE,
|
|
product STRING,
|
|
amount NUMBER,
|
|
quantity NUMBER DEFAULT 1
|
|
);
|
|
|
|
-- 重新插入测试数据
|
|
INSERT INTO orders VALUES ('o1', '1', 'Laptop', 1200, 1);
|
|
INSERT INTO orders VALUES ('o2', '1', 'Mouse', 50, 2);
|
|
INSERT INTO orders VALUES ('o3', '2', 'Keyboard', 150, 1);
|
|
|
|
-- 查看用户和订单
|
|
SELECT u.name, o.product, o.amount
|
|
FROM users u INNER JOIN orders o ON u.id = o.user_id;
|
|
|
|
-- 删除用户1 → 其订单自动级联删除
|
|
DELETE FROM users WHERE id = '1';
|
|
|
|
-- 确认:只剩用户2的订单
|
|
SELECT u.name, o.product, o.amount
|
|
FROM users u LEFT JOIN orders o ON u.id = o.user_id;`,
|
|
adv: `-- 复杂 WHERE:年龄在20-30之间且名字不是Bob
|
|
SELECT * FROM users
|
|
WHERE age BETWEEN 20 AND 30 AND name != 'Bob'
|
|
ORDER BY age DESC;
|
|
|
|
-- DISTINCT 去重
|
|
SELECT DISTINCT age FROM users ORDER BY age;
|
|
|
|
-- 多表 JOIN + 过滤 + 排序 + 分页
|
|
SELECT u.name, o.product, o.amount
|
|
FROM users u
|
|
INNER JOIN orders o ON u.id = o.user_id
|
|
WHERE o.amount >= 50
|
|
ORDER BY o.amount DESC
|
|
LIMIT 5 OFFSET 0;
|
|
|
|
-- 子查询 + 聚合混合
|
|
SELECT u.name, (
|
|
SELECT COUNT(*) FROM orders o WHERE o.user_id = u.id
|
|
) as order_count
|
|
FROM users u
|
|
WHERE u.age >= 25;`
|
|
};
|
|
|
|
function loadPreset(name) {
|
|
if (presets[name]) {
|
|
sqlInput.value = presets[name];
|
|
runQuery();
|
|
}
|
|
}
|
|
|
|
// Keyboard shortcut
|
|
document.addEventListener('keydown', e => {
|
|
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
|
|
e.preventDefault();
|
|
runQuery();
|
|
}
|
|
});
|
|
|
|
// Boot
|
|
initDB().then(() => {
|
|
console.log('✅ MetonaSqlark v0.1.14 demo ready');
|
|
setTimeout(runQuery, 300);
|
|
}).catch(err => {
|
|
renderError('初始化失败: ' + err.message);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|