Files
Baradb/docs/bg/schema.md
T
dimgigov e1bae0c7a0 Add comprehensive documentation with i18n support (EN/BG)
- Add docs/ folder with English (en/) and Bulgarian (bg/) documentation
- Create index.md with language switching and links
- English docs: installation, quickstart, architecture, baraql, storage,
  schema, lsm, btree, vector, graph, fts, columnar, transactions,
  distributed, protocol, udf, api-binary, api-http, api-websocket
- Bulgarian docs: installation, quickstart, architecture, baraql,
  schema, lsm, btree, vector, graph, fts, transactions, distributed
- Update README license to BSD 3-Clause
- Add LICENSE file with BSD 3-Clause text
2026-05-06 16:51:14 +03:00

1.0 KiB

Схема на BaraDB

BaraDB използва схема с типове, наследяване и автоматични миграции.

Дефиниране на Типове

import barabadb/schema/schema

var s = newSchema()

let person = newType("Person")
person.addProperty("name", "str", required = true)
person.addProperty("age", "int32")
s.addType("default", person)

Наследяване на Типове

let employee = newType("Employee")
employee.setBases(@["Person"])
employee.addProperty("department", "str")
s.addType("default", employee)

let resolved = s.resolveInheritance(employee)

Типове Полета

Тип Описание
str Низ
int32 32-битово цяло число
int64 64-битово цяло число
float32 32-битов float
float64 64-битов float
bool Булева стойност
datetime Дата/час
bytes Двоични данни