Skip to content

feat(transforms): add PostgreSQL lookup component for database queries - #342

Open
ZhuBit wants to merge 1 commit into
amphi-ai:mainfrom
ZhuBit:feature/postgres-lookup
Open

feat(transforms): add PostgreSQL lookup component for database queries#342
ZhuBit wants to merge 1 commit into
amphi-ai:mainfrom
ZhuBit:feature/postgres-lookup

Conversation

@ZhuBit

@ZhuBit ZhuBit commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Allow user to do sql lookup on external sources in middle of pipeline

@ZhuBit

ZhuBit commented Feb 12, 2026

Copy link
Copy Markdown
Contributor Author

PostgreSQL Database Lookup component enables data enrichment by executing SQL queries against PostgreSQL databases. It supports dynamic query parameterization using input DataFrame values, making it ideal for per-row lookups and data augmentation workflows.

Dynamic Query Parameterization
Use a special placeholder syntax to reference input DataFrame columns in SQL queries:
SELECT * FROM users WHERE user_id = input.DataFrame({'UserId'});

The component automatically:
Detects placeholders in the query
Executes one query per input row
Replaces placeholders with actual values from each row
Handles SQL escaping and NULL values

Two Query Modes
Lookup Mode (with placeholders):
Executes one query per input DataFrame row
Replaces input.DataFrame({'ColumnName'}) with actual row values
Merges results back to corresponding input rows
Ideal for per-row enrichment

Normal Mode (without placeholders):
Executes query once
Applies result columns to all input rows
Useful for global lookups or constant values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant