مُسو سو سو سو سِس سِر

نظرة عامة

البيانات تقرأ و تكتب خلال التشغيل ()؛ يحصل الحاسوب على إضافات اثنين ملفين خاصين به و قاذفاته الخاصة.

run() everywherefiles and terminals on a computer only
Using Python?

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

This is what api.storage.create(), connect(), device(), get() and list() all hand back. You never construct one. The reason it is a single type is the point of the whole resource: the code that reads a database we host is the code that reads one you connected.

السطح

العضو& & & &الوظيفة
تنفيذكل مايقرأ ويكتب البيانات
& لا شيء)الحواسيب فقط(تلك الآلة هي ملفاتها الخاصة
الميفادات)الحواسيب فقط(الصدفات و الخوادم التي تفوق على الإجابة

ما الذي يحمله

idstring

-المحددة. storageId أي مكان مطلوب

labelstring

اسم العرض. صاحب الحساب يمكن أن يغيره ، لذا لا تطابقه.

typestring

filesystem · phone · browser · database · object. الحقل الذي يجب أن يفرع.

providerstring

ما هو وراءه mongodb, d1, r2, s3, iagenify, machine, browser.

managedBystring

الذي يعمل عليه

servicestring|null

nosql · sql · object وضع IaGenify تخزين تخزين في التخزين. null (ب) أو

isDefaultboolean

IF a حفظ مع لا هدف هنا.

machineId · hostnamestring|null

على حاسوب: أي آلة.

deviceIdstring|null

على الهاتف: تحديد المتصفح يحتفظ به.

limitsobject

ما هي مسارات التخزين في الفضاء الخاص بها.

lastActivityAt · createdAtstring|null

عندما كان يستخدم آخر مرة، وعندما كان مسجلا.

لا يوجد شهادة على هذا كائن

ما زودته بالإتصال يستخدم من قبل الخادم للاتصال ولا يتم تسليمه أبداً. لا شيء هنا يمكن أن يتسرب كلمة مرور عن طريق الدخول أو الإرسال إلى صفحة.

الفرع على أساس نوع الفرع، لا على أساس مقدِّم الخدمات

provider (أ) أن تخبركم بما يوجد وراء التخزين؛ type و الثانية هي ما يجب أن تختبره شفرتك

for (const storage of await api.storage.list()) {
  switch (storage.type) {
    case "database":
      await storage.run({ action: "collections" });
      break;
    case "object":
      await storage.run({ action: "list" });
      break;
    case "filesystem":
      await storage.files.list();          // this machine's own files
      break;
    case "phone":
    case "browser":
      // Its files are in its browser — reachable from the page, not from here.
      break;
  }
}
for storage in api.storage.list():
    if storage.type == "database":
        storage.run(action="collections")
    elif storage.type == "object":
        storage.run(action="list")
    elif storage.type == "filesystem":
        storage.files.list()          # this machine's own files
    elif storage.type in ("phone", "browser"):
        pass  # Its files are in its browser — reachable from the page, not from here.

A أداة a a تخزين يُبقي خاصّته أداء

نوعبياناتهrun()& لا شيء
:: الجسمعلى الحسابنعملا:
أنتعلى تلك الآلة:: أن يكون محلياًنعم - على تلك الآلة
ميكرو ميكرو ميكرو ميكرو ميكروفي ذلك المتصفح:: أن يكون محلياًلا - انظر الجسر
وملفات ومحطات طرفيات ترمي بدلاً من إعادتها فارغة

على أي شيء ليس حاسوباً، الوصول إلى الملفات storage_not_local - - - أو - storage_is_phone على الهاتف، الذي يقول أين الملفات هي في الواقع. اختبار النوع أولاً؛ نتيجة فارغة ستكون كذبة.

import { IaGenifyError } from "iagenify";

try {
  await storage.files.list();
} catch (err) {
  if (err instanceof IaGenifyError && err.code === "storage_not_local") {
    // Not a computer. Its data is read through run().
  }
}
# In Python, files is None on anything that is not a computer:
# its data is read through run().
if storage.files is None:
    storage.run(action="collections")
else:
    storage.files.list()

نفس الشيء، أينما جاء من

const ours = await api.storage.create({ service: "nosql", label: "App data" });
const yours = await api.storage.connect({ label: "Prod", type: "database", provider: "mongodb",
  endpoint: { credentials: { uri } } });

// Identical calls, different backends
for (const base of [ours, yours]) {
  await base.run({ action: "count", collection: "events" });
}
ours = api.storage.create(service="nosql", label="App data")
yours = api.storage.connect(label="Prod", type="database", provider="mongodb",
                            endpoint={"credentials": {"uri": uri}})

# Identical calls, different backends
for base in (ours, yours):
    base.run(action="count", collection="events")