{"repo":"Jaymon/prom","free":true,"listed":false,"github":"https://github.com/Jaymon/prom","clone":"git clone https://github.com/Jaymon/prom.git","description":"A PostgreSQL or SQLite orm for Python","language":"Python","stars":24,"topics":["python","orm","postgres","sqlite-orm","sqlite","sqlite-database","postgresql-database","dsn","python3","async"],"license":"MIT","category":"databases-storage","readme_excerpt":"Prom An opinionated asynchronous lightweight orm for PostgreSQL or SQLite. 1 Minute Getting Started with SQLite First, install prom: $ pip install prom Set an environment variable: $ export PROM DSN=sqlite://:memory: Start python: $ python -m asyncio Create a prom Orm: Now go wild and create some Foo objects: Now query them: Update them: and get rid of them: Congratulations, you have now created, retrieved, updated, and deleted from your database. ------------------------------------------------------------------------------- Configuration Prom can be automatically configured on import by setting the environment variable PROM DSN . The PROM DSN should define a dsn url: :// : @ : / ? # The built-in interface classes don't need their full python paths, you can just use sqlite and postgres . So to use the builtin Postgres interface on testdb database on host localhost with username testuser and password testpw : postgres://testuser:testpw@localhost/testdb And to set it in your environment: export PROM DSN=postgres://testuser:testpw@localhost/testdb After you've set the environment variable, then you just need to import Prom in your code: and Prom will take care of parsing the dsn url(s) and creating the connection(s) automatically. Multiple db interfaces or connections If you have multiple connections, you can actually set multiple environment variables: export PROM DSN 1=postgres://testuser:testpw@localhost/testdb1#conn 1 export PROM DSN 2=sqlite://testuser:testpw@localhost/tes","default_branch":null,"files":null,"tree":[],"storefront":"/r/Jaymon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Jaymon/prom/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}