oktopios-orm 🐙🗄️
ORM pour le langage Oktopios — dans l'esprit de Doctrine (Symfony) et de l'ORM de Django : modèles déclarés par décorateurs, migrations automatiques, dépôt générique et query-builder.
Deuxième couche de l'écosystème :
langage oktopios → oktopios-orm → oktopios-framework.
Installation
pip install oktopios-orm
Cela installe aussi le langage oktopios (dépendance). Comme Django a besoin de
Python et Doctrine de PHP, oktopios-orm a besoin de l'interpréteur oktopios.
Utilisation
Dans un fichier .okp :
use "oktopios_orm/orm.okp" // résolu depuis le paquet installé
inject Type
@Entity("articles")
class Article {
@Id
var id: int
@Column("titre")
var title: string
var vues: int
fun __construct(title: string, vues: int) {
this.title = title
this.vues = vues
}
}
var schema = new Schema()
var sample = new Article("", 0)
schema.migrate("blog.db", sample) // CREATE TABLE articles (id INTEGER PRIMARY KEY, titre TEXT, vues INTEGER)
var repo = new Repo("blog.db", sample)
var a = new Article("Bonjour", 100)
Type.set(a, "id", 1)
repo.save(a)
for (x in repo.all()) { print(x.title) }
var q = new Query("blog.db", "articles")
print(q.select("id, titre, vues").where("vues", ">", 50).orderBy("vues", "DESC").get())
Exécuter : okp examples/blog.okp
Contenu (oktopios_orm/orm.okp)
Schema— migrations : génère le schéma SQL depuis les modèles décorés (@Entity,@Id,@Column) ; mapping des types (int→INTEGER,string→TEXT,float→REAL,bool→INTEGER).Repo— dépôt générique :save,all,findBy,remove, hydratation ligne → objet typé (par réflexion).Query— constructeur de requêtes fluide :select().where().orderBy().get(), paramétré (anti-injection).
Décorateurs reconnus
| Décorateur | Cible | Effet |
|---|---|---|
@Entity("table") |
classe | nom de la table |
@Column("colonne") |
champ | nom de la colonne |
@Id |
champ | clé primaire |
Licence
MIT © Mouanwiya Ali Soule
Metadata
Release files for oktopios-orm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oktopios_orm-0.1.0.tar.gz | 5.1 kB | Without provenance | Details for oktopios_orm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oktopios_orm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for oktopios_orm-0.1.0-py3-none-any.whl |
Total release size: 11.0 kB
Release files / oktopios_orm-0.1.0.tar.gz
| Download URL | oktopios_orm-0.1.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd87538047cb567b2bc7bb987a359e5804eabecb33e88867ddd577cc61856fb2
|
|
BLAKE2b-256 checksum How to use checksums |
5b87aa5809ca31250398412ba0aae669fc8d39a3cd95b17921fc58b016b8f0f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / oktopios_orm-0.1.0-py3-none-any.whl
| Download URL | oktopios_orm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
09095410153465bef8fac8962ced6cc30d288089c9c5cedcd0d3bee200b32a00
|
|
BLAKE2b-256 checksum How to use checksums |
7f24a1298ac40ad13158c18cbbfe5828263ba06242368635fb589269de1bf011
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for oktopios-orm 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.