Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richecr/pythonic-core-cpp
An extension for connecting to the database written in c/c++ to be used in Python, a performative way of making SQL queries.
https://github.com/richecr/pythonic-core-cpp
Last synced: about 4 hours ago
JSON representation
An extension for connecting to the database written in c/c++ to be used in Python, a performative way of making SQL queries.
- Host: GitHub
- URL: https://github.com/richecr/pythonic-core-cpp
- Owner: richecr
- Created: 2024-05-05T21:13:51.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T04:03:53.000Z (4 months ago)
- Last Synced: 2024-07-22T05:23:50.680Z (4 months ago)
- Language: C++
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pythonic Core - Extension in C++
> This is a package for database connections using PostgreSQL.An extension for connecting to the database written in c/c++ to be used in Python, a performative way of making SQL queries.
## Run local
### Libs postgresql:
```sh
sudo apt-get install postgresql postgresql-client libpq-dev
sudo apt-get install libpq-dev
```### Build:
```sh
python setup.py bdist_wheel
pip install dist/pythonic_core-0.1-cp312-cp312-linux_x86_64.whl --force-reinstall
```
or
```sh
make local/publish
```## Examples in Python:
### Example with postgres:
```python
import pythonic_coredb = pythonic_core.PostgresConnection()
db.connect(
"postgres://default:YqQ40GEUSxBL@ep-raspy-firefly-a4unwdoj-pooler.us-east-1.aws.neon.tech:5432/verceldb?sslmode=require"
)
r = db.fetch_all("select * from interaction", [])
for i in r:
print(i["created_at"].day)db.disconnect()
```### Example with sqlite:
```python
import pythonic_coredb = pythonic_core.SQLiteConnection()
db.connect("example.db")
r = db.fetch_all("select * from users")
for i in r:
print(i)db.disconnect()
```