تسجيل الدخول للوحة التحكم
| # |
|
|
|---|---|---|
| # | Name | Type | PK | NN | Default |
|---|---|---|---|---|---|
| Name | Unique | Origin |
|---|---|---|
التوثيق الكامل — API, Webhooks, MCP
https://turso.webylance.org
libSQL HTTP API — الوصول المباشر للقاعدة
https://studio.turso.webylance.org
لوحة التحكم — SQL Editor + AI + ER Canvas
https://api.turso.webylance.org
REST API + Webhooks + MCP Protocol
كل طلبات الـ API لازم يكون فيها Header:
Authorization: Bearer tsk-turso-master-2026
أو يمكنك إنشاء مفاتيح مخصصة عبر POST /api/keys
الصلاحيات المتاحة:
/health
فحص الحالة
/api/query
تنفيذ SQL
{"sql": "SELECT * FROM users LIMIT 10"}
/api/batch
تنفيذ عدة استعلامات
{"statements": ["INSERT INTO ...", "UPDATE ..."]}
/api/tables
عرض الجداول
/api/tables/{table}/rows
جلب الصفوف
Parameters: limit (default: 100), offset, order, where
/api/tables/{table}/rows
إضافة صف
{"name": "أحمد", "email": "ahmed@test.com"}
/api/tables/{table}/rows/{id}
تحديث صف
{"name": "أحمد محمد"}
/api/tables/{table}/rows/{id}
حذف صف
/api/tables/{table}/schema
هيكل الجدول
POST /api/webhooks
{
"name": "My App",
"url": "https://myapp.com/webhook",
"secret": "my-secret", // optional: HMAC signing
"events": "insert,update,delete", // which events
"tables": "*" // * = all tables
}
| Method | Endpoint | الوصف |
|---|---|---|
| GET | /api/webhooks | عرض الكل |
| DELETE | /api/webhooks/{id} | حذف |
| POST | /api/webhooks/{id}/toggle | تفعيل/تعطيل |
| POST | /api/webhooks/{id}/test | اختبار |
| GET | /api/webhooks/{id}/logs | سجل التسليم |
{
"event": "insert",
"table": "users",
"sql": "INSERT INTO users ...",
"result": {"affected": 1, "last_id": 5},
"timestamp": "2026-06-19T22:08:00Z",
"source": "turso-api"
}
Headers:
Content-Type: application/json
X-Turso-Event: insert
X-Turso-Table: users
X-Turso-Signature: <HMAC-SHA256> // if secret set
بروتوكول موحد يخلي AI agents (Claude, Cursor, Gemini) يتكلموا مع الـ database مباشرة.
POST https://api.turso.webylance.org/mcp Authorization: Bearer tsk-turso-master-2026 Content-Type: application/json
// .cursor/mcp.json or claude_desktop_config.json
{
"mcpServers": {
"turso": {
"url": "https://api.turso.webylance.org/mcp",
"headers": {
"Authorization": "Bearer tsk-turso-master-2026"
}
}
}
}
// Query
{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"query","arguments":{"sql":"SELECT * FROM users"}}}
// Insert
{"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"insert","arguments":{
"table":"users","data":{"name":"أحمد","email":"a@b.com"}}}}
POST /api/keys
{"name": "my-app", "permissions": "read,write"}
→ {"ok": true, "key": "tsk-xxxx...", "permissions": "read,write"}
GET /api/keys — عرض كل المفاتيح
DELETE /api/keys/{id} — حذف مفتاح
const API = 'https://api.turso.webylance.org';
const KEY = 'tsk-turso-master-2026';
const headers = {
'Authorization': `Bearer ${KEY}`,
'Content-Type': 'application/json'
};
// Query
const res = await fetch(`${API}/api/query`, {
method: 'POST', headers,
body: JSON.stringify({ sql: 'SELECT * FROM users' })
});
const data = await res.json();
console.log(data.rows);
// Insert
await fetch(`${API}/api/tables/users/rows`, {
method: 'POST', headers,
body: JSON.stringify({ name: 'أحمد', email: 'a@b.com' })
});
// Create Webhook
await fetch(`${API}/api/webhooks`, {
method: 'POST', headers,
body: JSON.stringify({
name: 'my-hook',
url: 'https://myapp.com/webhook',
events: 'insert,update'
})
});
import requests
API = 'https://api.turso.webylance.org'
KEY = 'tsk-turso-master-2026'
headers = {'Authorization': f'Bearer {KEY}',
'Content-Type': 'application/json'}
# Query
r = requests.post(f'{API}/api/query',
json={'sql': 'SELECT * FROM users'}, headers=headers)
print(r.json()['rows'])
# Insert
r = requests.post(f'{API}/api/tables/users/rows',
json={'name': 'أحمد'}, headers=headers)
print(r.json()) # {'ok': True, 'id': 5}
# Query
curl -X POST https://api.turso.webylance.org/api/query \
-H "Authorization: Bearer tsk-turso-master-2026" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT * FROM users"}'
# Create Webhook
curl -X POST https://api.turso.webylance.org/api/webhooks \
-H "Authorization: Bearer tsk-turso-master-2026" \
-H "Content-Type: application/json" \
-d '{"name":"n8n","url":"https://n8n.example.com/webhook/turso"}'
┌──────────────┐ ┌──────────────────┐ ┌──────────────┐
│ Your App │────▶│ API Gateway │────▶│ libSQL │
│ (any lang) │ │ :8072 │ │ :8080 │
└──────────────┘ │ ● REST API │ │ (Turso) │
│ ● Webhooks ─────┼──▶ External URLs
┌──────────────┐ │ ● MCP Protocol │ └──────────────┘
│ AI Agent │────▶│ │
│ (Claude) │ MCP └──────────────────┘
└──────────────┘
┌──────────────────┐
│ Studio (nginx) │
│ :80 │
│ ● SQL Editor │
│ ● ER Canvas │
│ ● AI Assistant │
└──────────────────┘
Turso Platform v2.0 — libSQL + API Gateway + MCP
Built with ❤️ by Webylance
اضغط + لإنشاء تبويب جديد