Plateforme dependency targets the main branch of the framework repository!
uv sync -U
uv run plateforme --help
uv run plateforme [command] --help
uv run plateforme build
uv run plateforme start --reload
It launches a shell with the server application loaded and the namespace variables:
app
: the loaded applicationplateforme
: the plateforme module
uv run plateforme shell
>>> app
Plateforme('plateforme-demo-application')
>>> from packages.users import User
>>> with app.session() as session:
... user = User(username='john', email='[email protected]', password='123')
... session.add(user)
... session.commit(expire=False)
>>> user
User(id=1, username='john', email='[email protected]')
>>> user.password
SecretStr('**********')
>>> from packages.social import Tweet
... with app.session() as session:
... tweet = Tweet(owner='1', content='My first tweet')
... tweet = session.merge(tweet)
... session.add(tweet)
... session.commit()
>>> with app.session() as session:
... session.query(Tweet).all()
[Tweet(id=1)]
>>> plateforme
<module 'plateforme' from '...'>
>>> plateforme.runtime.resources
{'packages.users.users.User': <class 'packages.users.users.User'>, ...}
>>> plateforme.framework.VERSION
'0.1.0-a1'