AIRport

所属分类:数据库系统
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2023-07-09 16:54:36
上 传 者sh-1993
说明:  超越去中心化应用程序
(Beyond Decentralized Apps)

文件列表:
.vscode/ (0, 2023-12-08)
.vscode/launch.json (7824, 2023-12-08)
.vscode/settings.json (1041, 2023-12-08)
AIRport_logo_2x1.png (40403, 2023-12-08)
LICENSE-APACHE (9694, 2023-12-08)
LICENSE-MIT (1023, 2023-12-08)
ORMs/ (0, 2023-12-08)
ORMs/self-query/ (0, 2023-12-08)
ORMs/self-query/tsconfig.json (318, 2023-12-08)
ORMs/tarmaq/ (0, 2023-12-08)
ORMs/tarmaq/dao/ (0, 2023-12-08)
ORMs/tarmaq/dao/package.json (981, 2023-12-08)
ORMs/tarmaq/dao/rollup.config.mjs (122, 2023-12-08)
ORMs/tarmaq/dao/src/ (0, 2023-12-08)
ORMs/tarmaq/dao/src/definition/ (0, 2023-12-08)
ORMs/tarmaq/dao/src/definition/IDao.ts (2517, 2023-12-08)
ORMs/tarmaq/dao/src/definition/IDatabaseFacade.ts (3995, 2023-12-08)
ORMs/tarmaq/dao/src/definition/IEntityDatabaseFacade.ts (1677, 2023-12-08)
ORMs/tarmaq/dao/src/definition/IFieldsSelect.ts (300, 2023-12-08)
ORMs/tarmaq/dao/src/definition/IObservableDao.ts (1454, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/ (0, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/IEntityFind.ts (840, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/IEntityFindOne.ts (771, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/IEntityLookup.ts (226, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/IEntitySearch.ts (855, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/IEntitySearchOne.ts (818, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/ILookup.ts (952, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/INonEntityFind.ts (1142, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/INonEntityFindOne.ts (1010, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/INonEntitySearch.ts (1041, 2023-12-08)
ORMs/tarmaq/dao/src/definition/query/INonEntitySearchOne.ts (1002, 2023-12-08)
ORMs/tarmaq/dao/src/implementation/ (0, 2023-12-08)
ORMs/tarmaq/dao/src/implementation/Dao.ts (7595, 2023-12-08)
... ...

# ![AIRport - Decentralized Relational Platform](https://github.com/AIRport_logo_2x1.png) ## Description AIRport allows Distributed Applications to interoperate by providing an API framework on top of a relational database. Data is stored in virual Repositories with one Transaction Log per repository. More documentation can be found at [Beyond Decentralized](https://github.comhttps://beyond-decentralized.world/documentation.html). ## How it works * User navigates to a web page and saves/retrieves data. * A new tab is opened in the background with AIRport framework in it * AIRport contacts Transaction Log data hosts (Ex: IPFS), retrieves data, puts into in-memory SqLite database, queries it, makes modifications to it, writes the Transaction Log entries back to data hosts. * Access to database is allowed only from App logic that runs in domain-sanboxed IFrames (inside AIRport tab). ## Build instructions If something isn't building and it really should, run 'rush update' Check out [AIRroot](https://github.comhttps://github.com/beyond-decentralized/AIRroot) for framework build instructions. ## Entity Definitions ```typescript @Entity() export class Parent extends AirEntity { value: string; total: number; @OneToMany({mappedBy: 'parent'}) children: Child[]; } @Entity() export class Child extends AirEntity { value: string; @ManyToOne() parent: Parent; } ``` ## Queries Apps can define entities which depend on entities in other Apps, via @ManyToOne() relations. Apps can build joins that include entities from other Apps. ## Data Access Objects (DAOs) ```typescript @Injected() export class ParentDao extends BaseParentDao { async findById( parentUuId: string ): Promise { let p: QParent, c: QChild return await this._findOne({ SELECT: { '*': Y, children: {} }, FROM: [ p = Q.Parent, c = p.children.LEFT_JOIN() ], WHERE: p.equals(parentUuId) }) } async updateInPlace( parent: Parent ): Promise { const p: QParent await this._updateWhere({ UPDATE: p = Q.Parent, SET: { total: PLUS(p.total, 1) }, WHERE: p.equals(parent) }) } } ``` ## APIs Public API methods are annotated with @Api() decorator. Apps can invoke @Api() methods of other Apps. Apps can join across application schemas but must call APIs of other Apps to modify their data. ```typescript @Injected() export class ParentApi { @Inject() parentDao: ParentDao @Api() async save( parent: Parent ): Promise { await this.parentDao.save(parent) } @Api() async findById( parentUuId: string ): Promise { return await this.parentDao.findById(parentUuId) } } ``` ## Directory Structure [ORMs](https://github.com/ORMs) Object Relational Mapping frameworks. [apis](https://github.com/apis) Internal and external APIs. [databases](https://github.com/databases) Database adapters. [engines](https://github.com/engines) Core Logic of AIRport. [generators](https://github.com/generators) Code generators. [libs](https://github.com/libs) Libraries. [platforms](https://github.com/platforms) Platform adaptors for Web and Native. [schemas](https://github.com/schemas) Internal AIRport schemas. ## Latest Find out about the latest developments at the [Beyond Decentralized blog](https://github.comhttps://beyond-decentralized.world/blog.html) ## License AIRport is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](https://github.comLICENSE-APACHE), [LICENSE-MIT](https://github.comLICENSE-MIT)

近期下载者

相关文件


收藏者