Skip to content

Xuanwo/opendal-python-postgresql-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenDAL Python PostgreSQL Example

This project demonstrates how to use OpenDAL Python binding to interact with PostgreSQL as a key-value storage backend. OpenDAL (Open Data Access Layer) provides a unified API for accessing various storage services, making it easy to switch between different backends with minimal code changes.

Prerequisites

  • Python 3.12 or higher
  • Docker and Docker Compose
  • uv for Python package management

Setup

  1. Clone this repository:
git clone https://github.com/Xuanwo/opendal-python-postgresql-example.git
cd opendal-python-postgresql-example
  1. Install dependencies using uv:
uv pip install -e .
  1. Start the PostgreSQL container:
docker-compose up -d

This will start a PostgreSQL server and initialize it with the required schema and test data.

Running the Example

Execute the main script:

python main.py

The example script demonstrates:

  • Connecting to PostgreSQL using OpenDAL
  • Writing data to the PostgreSQL backend
  • Reading data from PostgreSQL
  • Checking if objects exist
  • Deleting objects

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages