Skip to content

Add pgvector support to PostgreSQL dialect#2083

Open
benfdking wants to merge 1 commit intomainfrom
claude/add-pgvector-support-znEgt
Open

Add pgvector support to PostgreSQL dialect#2083
benfdking wants to merge 1 commit intomainfrom
claude/add-pgvector-support-znEgt

Conversation

@benfdking
Copy link
Collaborator

Add support for pgvector types (VECTOR, HALFVEC, SPARSEVEC) as a configurable extension for the PostgreSQL dialect. This fixes the indentation bug when using VECTOR type in CREATE TABLE statements.

Configuration:

[sqruff]
dialect = postgres

[sqruff:postgres]
extensions = pgvector

This adds:

  • apply_pgvector_extension function in postgres.rs that adds pgvector types with optional dimension parameters (e.g., VECTOR(3072))
  • Configuration support in FluffConfig to read postgres-specific extensions
  • Feature flag propagation from sqruff-lib to sqruff-lib-dialects

Fixes #2070

Add support for pgvector types (VECTOR, HALFVEC, SPARSEVEC) as a configurable
extension for the PostgreSQL dialect. This fixes the indentation bug when using
VECTOR type in CREATE TABLE statements.

Configuration:
```ini
[sqruff]
dialect = postgres

[sqruff:postgres]
extensions = pgvector
```

This adds:
- `apply_pgvector_extension` function in postgres.rs that adds pgvector types
  with optional dimension parameters (e.g., VECTOR(3072))
- Configuration support in FluffConfig to read postgres-specific extensions
- Feature flag propagation from sqruff-lib to sqruff-lib-dialects

Fixes #2070
@github-actions
Copy link

Benchmark for af90c29

Click to view benchmark
Test Base PR %
DepthMap::from_parent 54.6±0.56µs 54.4±0.48µs -0.37%
fix_complex_query 11.7±0.05ms 11.7±0.17ms 0.00%
fix_superlong 128.8±13.90ms 131.5±14.10ms +2.10%
parse_complex_query 4.2±0.08µs 4.2±0.05µs 0.00%
parse_expression_recursion 7.3±0.11µs 7.4±0.11µs +1.37%
parse_simple_query 1047.5±23.16ns 1061.2±17.53ns +1.31%

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.

[Bug]: PSQL CREATE TABLE with VECTOR not indented

2 participants