المزوّدون

IaGenify سحاب

api.storage.create({ service, label }) → Promise<ConnectedStorage>

قاعدة بيانات أو دلو لا يوجد ما يربطه: لا يوجد حساب في مكان آخر، لا وثائق تفويض، لا عنوان، ثلاث خدمات، كل منها تأخذ شكل مقدم خدمات تعرفه بالفعل.

provider: iagenifyno credentialscounted against the plan
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

النقطة هي أن بقية شفرتك لا تتغير. تخزين تم إنشاءه هنا يجيب نفسه run() كإجراء متصل بأحد أشكال المطابقات -- لذا الفرع الذي كتبته لقاعدة بيانات العميل يعمل على أحدنا، وعلى الطريق الآخر.

الخدمات الثلاث

خدمةنوعقُر مثل:
nosqldatabaseألف - قاعدة بيانات وثيقةإن منغولديد :
sqldatabaseقاعدة بيانات علاقةtables · overview · execute
objectobjectدللإن طراز :
const base = await api.storage.create({ service: "nosql", label: "App data" });

await base.run({ action: "insert", collection: "events", documents: [{ at: new Date(), kind: "signup" }] });
await base.run({ action: "count", collection: "events" });

// base.service === "nosql"   base.provider === "iagenify"   base.managedBy === "iagenify"
from datetime import datetime, timezone

base = api.storage.create(service="nosql", label="App data")

base.run(action="insert", collection="events",
         documents=[{"at": datetime.now(timezone.utc).isoformat(), "kind": "signup"}])
base.run(action="count", collection="events")

# base.service == "nosql"   base.provider == "iagenify"   base.managed_by == "iagenify"

service is how you tell them apart

type يقول ما يمكنك القيام به؛ provider يقول iagenify(ب) service — null على كل مخزن متصل ، اي من هذه الثلاثة هو المجال الذي يجب ان تقرأ فيه متى تحتاج ان تعرف من هو المكان الذي يُستهلك .

كل حساب يولد مع واحد

يوجد شيء قبل أن تسأل

يتم إنشاء حساب مع تخزينه الخاص، وهذا التخزين هو افتراض الحساب - لذلك حفظ دون وجود أراضي مستهدفة هناك. بما أن الخطط تتضمن تخزين شيء واحد، يُرفض طلب ثانية: الشخص الذي لديك هو الذي تعطيه الخطة.

الفضاء هو كل مكان تخزين، ويتم إنفاذه

لكل مخزن سقفه الخاص به وليس حصة من مجمع مشترك. quota_exceeded (403) قبل تخزين أي شيء؛ قراءة وحذف مواصلة العمل، وهذا ما يسمح لك بتحرير الفضاء دون شراء أي منها.

import { IaGenifyError } from "iagenify";

try {
  await base.run({ action: "insert", collection: "events", documents });
} catch (err) {
  if (err instanceof IaGenifyError && err.code === "quota_exceeded") {
    // Delete something, or add space: see api.cloud.addons.buy()
  }
}
from iagenify import IaGenifyError

try:
    base.run(action="insert", collection="events", documents=documents)
except IaGenifyError as error:
    if error.code != "quota_exceeded":
        raise
    # Delete something, or add space: see api.cloud.addons.buy()

الـ SQL وما لا تملكه

sql answers tables, overview and execute, with params bound the same way as D1. Two things are its own: a statement has a time limit, and passing it raises query_timeout (408) rather than hanging; and execute reports sizeAfter, the size of the database once the statement has run.

const sql = await api.storage.create({ service: "sql", label: "Reporting" });

await sql.run({ action: "execute", sql: "CREATE TABLE visits (id INTEGER PRIMARY KEY, at TEXT)" });
await sql.run({ action: "execute", sql: "INSERT INTO visits (at) VALUES (?)", params: [new Date().toISOString()] });
// { rows: [], rowsRead: null, rowsWritten: null, sizeAfter: 12288 }
from datetime import datetime, timezone

sql = api.storage.create(service="sql", label="Reporting")

sql.run(action="execute", sql="CREATE TABLE visits (id INTEGER PRIMARY KEY, at TEXT)")
sql.run(action="execute", sql="INSERT INTO visits (at) VALUES (?)",
        params=[datetime.now(timezone.utc).isoformat()])
# {"rows": [], "rowsRead": None, "rowsWritten": None, "sizeAfter": 12288}

خدمة

Keys are yours, with no prefix added and none to strip. list, overview, object, upload and delete behave as on a connected bucket, and an invalid key is refused with invalid_key (400) rather than being cleaned into something you did not ask for.

الأخطاء

الرمزالحالةمتى
invalid_service400service أو ليس أحد الثلاثة
cloud_storage_limit403تم بالفعل استخدام حساب الخطة لتلك الخدمة.
quota_exceeded403الكتابة ستمر عبر سقف هذا المخزن
query_timeout408A SQL البيان تم تنفيذه منذ فترة طويلة
invalid_key400أداة تعريف كائنات لا يمكن تخزينها.
object_not_found404لا يوجد هدف في هذا المفتاح

ما هو وراءه ليس جزءاً من العقد

لا شيء من التنفيذ يُعاد: لا عنوان، لا وثائق تفويض، لا هوية داخلية، ما تحصل عليه هو الشكل - وهذا هو الجزء الذي نبقيه مستقرين.