सामग्री पर जाएँ
ऑराबेस लोगो
aurabase

पंक्तियाँ सम्मिलित करें

POST/v1/db/{project_id}/{table}

प्रोजेक्ट स्कीमा में एक तालिका में एक या अधिक रिकॉर्ड सम्मिलित करता है। on_conflict के माध्यम से upsert का समर्थन करता है और डिफ़ॉल्ट रूप से बनाई गई पंक्तियों को लौटाता है।

इस अनुवाद के बाद से अंग्रेजी स्रोत बदल गया है। कुछ जानकारी पुरानी हो सकती है.
यह पृष्ठ स्वचालित रूप से अनुवादित किया गया था. अंग्रेजी संस्करण प्रामाणिक है.

Headers#

HeaderRequiredValue
apikeyyesProject API key (anon or service_role). X-API-Key is accepted too.
AuthorizationnoBearer <JWT>. Without it, the request runs as anon
Content-Typeyesapplication/json
Preferno`return=representation (default) \

Body parameters#

ParameterTypeRequiredDescription
tablestringyesName of the target table, in the path. Internal tables prefixed _aura_ are refused in 403.
values`object \object[]`yes
values.iduuid—Default: gen_random_uuid(). Omit for server generation.
values.created_attimestamptz—Default: now(). Omit for server timestamp.
values.[key]any—Any column declared by your schema.
on_conflictstringnoQuery parameter (no body). Constraint column(s) for upsert: ?on_conflict=id. An upsert responds 200 OK, a simple insert 201 Created.

Response codes#

  • 201 Created — Insertion successful. Body = { data, meta } by default.
  • 200 OK — Upsert succeeded (?on_conflict= present).
  • 204 No Content — Prefer: return=minimal — no body, Preference-Applied header returned.
  • 400 Bad Request — Body, unknown column, or empty array. error.code = BAD_REQUEST or COLUMN_NOT_FOUND.
  • 403 Forbidden — RLS refuses write, or internal table _aura_*.
  • 409 Conflict — Single constraint violation without on_conflict. error.code = DUPLICATE_KEY.
  • 413 Payload Too Large — Request body beyond MAX_BODY_SIZE (default 50 MB). There is no cap on the number of lines.

To know#

जानकारी

The Prefer: return=representation header is added automatically by the SDK. Add Prefer: return=minimal to make the answer lighter.

ध्यान

Batch inserts are atomic: if one row violates a constraint, all are rolled back.

ध्यान

The Idempotency-Key header is not read on this route: two identical POSTs with the same key create two rows. To deduplicate, use ?on_conflict= and a unique constraint.

आखरी अपडेट · @aurabase/aurabase-js@0.7.5 · aura@0.3.4↗ किसी समस्या की रिपोर्ट करें