@@ -49,7 +49,7 @@ So let's start from the bottom and work our way up, shall we?
49
49
AiiDA uses SQLAlchemy's declarative approach to define database tables.
50
50
This means the database schema is defined using Python classes rather than raw SQL.
51
51
Here's how the core
52
- [ ` DbNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/models/node.py#L22 )
52
+ [ ` DbNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/models/node.py )
53
53
model is constructed[ ^ 1 ] :
54
54
55
55
``` python
@@ -117,7 +117,7 @@ Some of the key features of AiiDA's SQLAlchemy models are:
117
117
## The abstract interface: ` BackendNode `
118
118
119
119
Above the database layer sits the abstract
120
- [ ` BackendNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/orm/implementation/nodes.py#L27 )
120
+ [ ` BackendNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/orm/implementation/nodes.py )
121
121
class, which defines the interface contract that all database backend implementations must follow:
122
122
123
123
``` python
@@ -152,7 +152,7 @@ The abstract class serves as a __contract__ —any backend implementation must p
152
152
## The ORM layer: ` SqlaNode `
153
153
154
154
The
155
- [ ` SqlaNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/orm/nodes.py#L30 )
155
+ [ ` SqlaNode ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/orm/nodes.py )
156
156
class bridges the abstract ` BackendNode ` interface with the concrete SQLAlchemy models:
157
157
158
158
``` python
@@ -207,7 +207,7 @@ class SqlaNode(entities.SqlaModelEntity[models.DbNode], ExtrasMixin, BackendNode
207
207
```
208
208
209
209
` SqlaNode ` wraps a raw ` DbNode ` SQLAlchemy model in a
210
- [ ` ModelWrapper ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/orm/utils.py#L27 )
210
+ [ ` ModelWrapper ` ] ( https://github.com/aiidateam/aiida-core/blob/313f342f5d28eeba5967fec8196ed6fce393a77a/src/aiida/storage/psql_dos/orm/utils.py )
211
211
that handles session management automatically.
212
212
This wrapping provides two levels of access: ` node.model ` for the wrapped model with automatic session tracking, and ` node.bare_model ` for direct access to the raw SQLAlchemy model when you need to bypass AiiDA's management.
213
213
Beyond model wrapping, ` SqlaNode ` is responsible for actual database storage via its ` store ` method.
@@ -382,7 +382,7 @@ The integration of `pydantic` brings various additional features and advantages:
382
382
# ## The QueryBuilder
383
383
384
384
The
385
- [`QueryBuilder` ](https:// github.com/ aiidateam/ aiida- core/ blob/ 313f342f5d28eeba5967fec8196ed6fce393a77a / src/ aiida/ orm/ querybuilder.py# L79 )
385
+ [`QueryBuilder` ](https:// github.com/ aiidateam/ aiida- core/ blob/ 313f342f5d28eeba5967fec8196ed6fce393a77a / src/ aiida/ orm/ querybuilder.py)
386
386
is AiiDA' s main Python API to retrieve data from the database.
387
387
It provides a uniform, backend- agnostic interface:
388
388
0 commit comments