Skip to content

Commit 1ff2ee1

Browse files
authored
refactor: rename crates to pgls_* (#581)
1 parent 8f7626a commit 1ff2ee1

File tree

750 files changed

+722439
-2347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

750 files changed

+722439
-2347
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
with:
208208
install-lib: false
209209
- name: Build main binary
210-
run: cargo build -p pgt_cli --release
210+
run: cargo build -p pgls_cli --release
211211
- name: Setup Bun
212212
uses: oven-sh/setup-bun@v2
213213
- name: Install JS dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
8686

8787
- name: 🛠️ Run Build
88-
run: cargo build -p pgt_cli --release --target ${{ matrix.config.target }}
88+
run: cargo build -p pgls_cli --release --target ${{ matrix.config.target }}
8989
env:
9090
# Strip all debug symbols from the resulting binaries
9191
RUSTFLAGS: "-C strip=symbols -C codegen-units=1"

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "crates/pgt_query/vendor/libpg_query"]
2-
path = crates/pgt_query/vendor/libpg_query
2+
path = crates/pgls_query/vendor/libpg_query
33
url = https://github.com/pganalyze/libpg_query.git
44
branch = 17-latest

AGENTS.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ just test
2727
# or: cargo test run --no-fail-fast
2828

2929
# Test specific crate
30-
just test-crate pgt_lsp
30+
just test-crate pgls_lsp
3131

3232
# Run doc tests
3333
just test-doc
@@ -64,41 +64,41 @@ just new-crate <name>
6464
### CLI Usage
6565
The main CLI binary is `postgrestools`:
6666
```bash
67-
cargo run -p pgt_cli -- check file.sql
67+
cargo run -p pgls_cli -- check file.sql
6868
# or after building:
6969
./target/release/postgrestools check file.sql
7070
```
7171

7272
## Architecture
7373

7474
### Crate Structure
75-
The project uses a modular Rust workspace with crates prefixed with `pgt_`:
75+
The project uses a modular Rust workspace with crates prefixed with `pgls_`:
7676

7777
**Core Infrastructure:**
78-
- `pgt_workspace` - Main API and workspace management
79-
- `pgt_lsp` - Language Server Protocol implementation
80-
- `pgt_cli` - Command-line interface
81-
- `pgt_fs` - Virtual file system abstraction
82-
- `pgt_configuration` - Configuration management
78+
- `pgls_workspace` - Main API and workspace management
79+
- `pgls_lsp` - Language Server Protocol implementation
80+
- `pgls_cli` - Command-line interface
81+
- `pgls_fs` - Virtual file system abstraction
82+
- `pgls_configuration` - Configuration management
8383

8484
**Parser and Language Processing:**
85-
- `pgt_query` - Postgres query parsing (wraps libpg_query)
86-
- `pgt_lexer` - SQL tokenizer with whitespace handling
87-
- `pgt_statement_splitter` - Splits source into individual statements
88-
- `pgt_treesitter` - Tree-sitter integration for additional parsing
85+
- `pgls_query` - Postgres query parsing (wraps libpg_query)
86+
- `pgls_lexer` - SQL tokenizer with whitespace handling
87+
- `pgls_statement_splitter` - Splits source into individual statements
88+
- `pgls_treesitter` - Tree-sitter integration for additional parsing
8989

9090
**Features:**
91-
- `pgt_completions` - Autocompletion engine
92-
- `pgt_hover` - Hover information provider
93-
- `pgt_analyser` & `pgt_analyse` - Linting and analysis framework
94-
- `pgt_typecheck` - Type checking via EXPLAIN
95-
- `pgt_schema_cache` - In-memory database schema representation
91+
- `pgls_completions` - Autocompletion engine
92+
- `pgls_hover` - Hover information provider
93+
- `pgls_analyser` & `pgls_analyse` - Linting and analysis framework
94+
- `pgls_typecheck` - Type checking via EXPLAIN
95+
- `pgls_schema_cache` - In-memory database schema representation
9696

9797
**Utilities:**
98-
- `pgt_diagnostics` - Error and warning reporting
99-
- `pgt_console` - Terminal output and formatting
100-
- `pgt_text_edit` - Text manipulation utilities
101-
- `pgt_suppressions` - Rule suppression handling
98+
- `pgls_diagnostics` - Error and warning reporting
99+
- `pgls_console` - Terminal output and formatting
100+
- `pgls_text_edit` - Text manipulation utilities
101+
- `pgls_suppressions` - Rule suppression handling
102102

103103
### TypeScript Packages
104104
Located in `packages/` and `editors/`:
@@ -111,15 +111,15 @@ The server connects to a Postgres database to build an in-memory schema cache co
111111

112112
### Statement Processing Flow
113113
1. Input source code is split into individual SQL statements
114-
2. Each statement is parsed using libpg_query (via `pgt_query`)
114+
2. Each statement is parsed using libpg_query (via `pgls_query`)
115115
3. Statements are analyzed against the schema cache
116116
4. Results are cached and updated incrementally on file changes
117117

118118
## Testing
119119

120120
### Test Data Location
121-
- SQL test cases: `crates/pgt_statement_splitter/tests/data/`
122-
- Analyzer test specs: `crates/pgt_analyser/tests/specs/`
121+
- SQL test cases: `crates/pgls_statement_splitter/tests/data/`
122+
- Analyzer test specs: `crates/pgls_analyser/tests/specs/`
123123
- Example SQL files: `example/`, `test.sql`
124124

125125
### Snapshot Testing
@@ -145,10 +145,10 @@ cargo insta review
145145
## Development Notes
146146

147147
### Code Generation
148-
Many parser structures are generated from PostgreSQL's protobuf definitions using procedural macros in `pgt_query_macros`. Run `just gen-lint` after modifying analyzer rules or configurations.
148+
Many parser structures are generated from PostgreSQL's protobuf definitions using procedural macros in `pgls_query_macros`. Run `just gen-lint` after modifying analyzer rules or configurations.
149149

150150
### Database Schema
151-
The `pgt_schema_cache` crate contains SQL queries in `src/queries/` that introspect the database schema to build the in-memory cache.
151+
The `pgls_schema_cache` crate contains SQL queries in `src/queries/` that introspect the database schema to build the in-memory cache.
152152

153153
### Multi-Platform Support
154154
The project includes platform-specific allocators and build configurations for Windows, macOS, and Linux.

0 commit comments

Comments
 (0)