Simpler demo
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, sqlite
- Lĩnh vực
- documentation
Hướng nghiên cứu
Open the README and find the current sample demo. Replace or revise it using the simpler JavaScript and SQL.js example in the issue, while retaining the previous-version example if it is useful. Done means the README presents the proposed browser demo accurately and its code is readable and runnable.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The sample demo in the readme seems intimidating...
Here's a simpler one:
<head>
<title>Demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.12.0/sql-wasm.js"></script>
<!-- preload sql-wasm.wasm, if you like -->
</head>
<body>
<button id='btn'>Run query</button>
<script type='module'>
// Initialize SQL.js
const SQL = await initSqlJs({
locateFile: () => `https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.12.0/sql-wasm.wasm`
})
// Create a db with sample data
const db = new SQL.Database()
db.run(`CREATE TABLE test (id INTEGER, name TEXT); INSERT INTO test VALUES (1, 'Alice'), (2, 'Bob')`)
// Run a query
async function run() {
const result = await db.exec("SELECT * FROM test")
console.log(result[0].values)
}
btn.addEventListener('click', run)
</script>
</body>
For previous versions:
<head>
<title>Demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/0.5.0/js/sql-optimized.js"></script>
</head>
<body>
<button id='btn'>Run query</button>
<script type='module'>
const db = new SQL.Database()
db.run(`CREATE TABLE test (id INTEGER, name TEXT); INSERT INTO test VALUES (1, 'Alice'), (2, 'Bob')`)
async function run() {
const result = await db.exec("SELECT * FROM test")
console.log(result[0].values)
}
btn.addEventListener('click', run)
</script>
</body>
- Ngôn ngữ chính
- JavaScript
- Star
- 13.7k
- Fork
- 1.1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sql-js/sql.js
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Add the WebWorker API docs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Tất cả issue của sql-js/sql.js
Issue tương tự
-
code-quality refactoring
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100