Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: rename crates to pgls_*#581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
psteinroe merged 3 commits intomainfromrefactor/crate-names
Oct 28, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion.github/workflows/pull_request.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -207,7 +207,7 @@ jobs:
with:
install-lib: false
- name: Build main binary
run: cargo build -ppgt_cli --release
run: cargo build -ppgls_cli --release
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install JS dependencies
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/release.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,7 +85,7 @@ jobs:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres

- name: 🛠️ Run Build
run: cargo build -ppgt_cli --release --target ${{ matrix.config.target }}
run: cargo build -ppgls_cli --release --target ${{ matrix.config.target }}
env:
# Strip all debug symbols from the resulting binaries
RUSTFLAGS: "-C strip=symbols -C codegen-units=1"
Expand Down
2 changes: 1 addition & 1 deletion.gitmodules
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
[submodule "crates/pgt_query/vendor/libpg_query"]
path = crates/pgt_query/vendor/libpg_query
path = crates/pgls_query/vendor/libpg_query
url = https://github.com/pganalyze/libpg_query.git
branch = 17-latest
52 changes: 26 additions & 26 deletionsAGENTS.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,7 @@ just test
# or: cargo test run --no-fail-fast

# Test specific crate
just test-cratepgt_lsp
just test-cratepgls_lsp

# Run doc tests
just test-doc
Expand DownExpand Up@@ -64,41 +64,41 @@ just new-crate <name>
### CLI Usage
The main CLI binary is `postgrestools`:
```bash
cargo run -ppgt_cli -- check file.sql
cargo run -ppgls_cli -- check file.sql
# or after building:
./target/release/postgrestools check file.sql
```

## Architecture

### Crate Structure
The project uses a modular Rust workspace with crates prefixed with `pgt_`:
The project uses a modular Rust workspace with crates prefixed with `pgls_`:

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

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

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

**Utilities:**
- `pgt_diagnostics` - Error and warning reporting
- `pgt_console` - Terminal output and formatting
- `pgt_text_edit` - Text manipulation utilities
- `pgt_suppressions` - Rule suppression handling
- `pgls_diagnostics` - Error and warning reporting
- `pgls_console` - Terminal output and formatting
- `pgls_text_edit` - Text manipulation utilities
- `pgls_suppressions` - Rule suppression handling

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

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

## Testing

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

### Snapshot Testing
Expand All@@ -145,10 +145,10 @@ cargo insta review
## Development Notes

### Code Generation
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.
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.

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

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

[8]ページ先頭

©2009-2025 Movatter.jp