|
| 1 | +ParadeDB on LocalStack |
| 2 | +====================== |
| 3 | + |
| 4 | +This repo contains a [LocalStack Extension](https://github.com/localstack/localstack-extensions) that facilitates developing [ParadeDB](https://www.paradedb.com)-based applications locally. |
| 5 | + |
| 6 | +ParadeDB is an Elasticsearch alternative built on Postgres. It provides full-text search with BM25 scoring, hybrid search combining semantic and keyword search, and real-time analytics capabilities. |
| 7 | + |
| 8 | +After installing the extension, a ParadeDB server instance will become available and can be accessed using standard PostgreSQL clients. |
| 9 | + |
| 10 | +## Connection Details |
| 11 | + |
| 12 | +Once the extension is running, you can connect to ParadeDB using any PostgreSQL client with the following default credentials: |
| 13 | + |
| 14 | +- **Host**: `localhost` (or the Docker host if running in a container) |
| 15 | +- **Port**: `5432` (mapped from the container) |
| 16 | +- **Database**: `postgres` |
| 17 | +- **Username**: `postgres` |
| 18 | +- **Password**: `postgres` |
| 19 | + |
| 20 | +Example connection using `psql`: |
| 21 | +```bash |
| 22 | +psql -h localhost -p 5432 -U postgres -d postgres |
| 23 | +``` |
| 24 | + |
| 25 | +Example connection using Python: |
| 26 | +```python |
| 27 | +import psycopg2 |
| 28 | + |
| 29 | +conn = psycopg2.connect( |
| 30 | + host="localhost", |
| 31 | + port=5432, |
| 32 | + database="postgres", |
| 33 | + user="postgres", |
| 34 | + password="postgres" |
| 35 | +) |
| 36 | +``` |
| 37 | + |
| 38 | +## ParadeDB Features |
| 39 | + |
| 40 | +ParadeDB includes several powerful extensions: |
| 41 | + |
| 42 | +- **pg_search**: Full-text search with BM25 ranking |
| 43 | +- **pg_analytics**: DuckDB-powered analytics for OLAP workloads |
| 44 | +- **pg_lakehouse**: Query data lakes (S3, Delta Lake, Iceberg) directly |
| 45 | + |
| 46 | +Example using pg_search: |
| 47 | +```sql |
| 48 | +-- Create a table with search index |
| 49 | +CREATE TABLE products ( |
| 50 | + id SERIAL PRIMARY KEY, |
| 51 | + name TEXT, |
| 52 | + description TEXT |
| 53 | +); |
| 54 | + |
| 55 | +-- Create a BM25 search index |
| 56 | +CALL paradedb.create_bm25( |
| 57 | + index_name => 'products_idx', |
| 58 | + table_name => 'products', |
| 59 | + key_field => 'id', |
| 60 | + text_fields => paradedb.field('name') || paradedb.field('description') |
| 61 | +); |
| 62 | + |
| 63 | +-- Search with BM25 scoring |
| 64 | +SELECT * FROM products.search('description:electronics'); |
| 65 | +``` |
| 66 | + |
| 67 | +## Configuration |
| 68 | + |
| 69 | +The following environment variables can be passed to the LocalStack container to configure the extension: |
| 70 | + |
| 71 | +* `PARADEDB_POSTGRES_USER`: PostgreSQL username (default: `postgres`) |
| 72 | +* `PARADEDB_POSTGRES_PASSWORD`: PostgreSQL password (default: `postgres`) |
| 73 | +* `PARADEDB_POSTGRES_DB`: Default database name (default: `postgres`) |
| 74 | + |
| 75 | +## Prerequisites |
| 76 | + |
| 77 | +* Docker |
| 78 | +* LocalStack Pro (free trial available) |
| 79 | +* `localstack` CLI |
| 80 | +* `make` |
| 81 | + |
| 82 | +## Install from GitHub repository |
| 83 | + |
| 84 | +This extension can be installed directly from this Github repo via: |
| 85 | + |
| 86 | +```bash |
| 87 | +localstack extensions install "git+https://github.com/localstack/localstack-extensions.git#egg=localstack-extension-paradedb&subdirectory=paradedb" |
| 88 | +``` |
| 89 | + |
| 90 | +## Install local development version |
| 91 | + |
| 92 | +Please refer to the docs [here](https://github.com/localstack/localstack-extensions?tab=readme-ov-file#start-localstack-with-the-extension) for instructions on how to start the extension in developer mode. |
| 93 | + |
| 94 | +## Change Log |
| 95 | + |
| 96 | +* `0.1.0`: Initial version of the extension |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +The code in this repo is available under the Apache 2.0 license. |
0 commit comments