File tree Expand file tree Collapse file tree 2 files changed +37
-15
lines changed
Expand file tree Collapse file tree 2 files changed +37
-15
lines changed Original file line number Diff line number Diff line change @@ -339,3 +339,33 @@ This project is licensed under the MIT License.
339339
340340- [ libpg_query] ( https://github.com/pganalyze/libpg_query ) - The core PostgreSQL parser library
341341- PostgreSQL community for the robust SQL grammar
342+
343+ ## Development Setup
344+
345+ This repository uses git submodules for the libpg_query dependency. After cloning:
346+
347+ ``` bash
348+ # Clone the repository
349+ git clone https://github.com/jonatas/pgquery-dotnet.git
350+ cd pgquery-dotnet
351+
352+ # Initialize and fetch submodules
353+ git submodule update --init --recursive
354+
355+ # Build the project
356+ ./scripts/build.sh
357+ ```
358+
359+ ### Working with Submodules
360+
361+ The ` libpg_query ` directory is a git submodule pointing to the official [ libpg_query repository] ( https://github.com/pganalyze/libpg_query ) . This keeps our repository lightweight while maintaining access to the PostgreSQL parser.
362+
363+ To update the submodule to a newer version:
364+ ``` bash
365+ cd libpg_query
366+ git fetch origin
367+ git checkout 17-latest # or desired version
368+ cd ..
369+ git add libpg_query
370+ git commit -m " Update libpg_query submodule"
371+ ```
Original file line number Diff line number Diff line change @@ -7,24 +7,16 @@ echo "🏗️ Building PgQuery.NET with libpg_query..."
77SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
88PROJECT_ROOT=" $SCRIPT_DIR /.."
99
10- # Configuration
11- LIBPG_QUERY_BRANCH=" 17-latest"
12- LIBPG_QUERY_REPO=" https://github.com/pganalyze/libpg_query.git"
13-
1410cd " $PROJECT_ROOT "
1511
16- # Step 1: Clone and build libpg_query
17- echo " 📥 Setting up libpg_query..."
18- if [ ! -d " libpg_query" ]; then
19- echo " Cloning libpg_query (branch: $LIBPG_QUERY_BRANCH ) ..."
20- git clone -b " $LIBPG_QUERY_BRANCH " " $LIBPG_QUERY_REPO "
12+ # Step 1: Initialize and update git submodules
13+ echo " 📥 Setting up libpg_query submodule ..."
14+ if [ ! -f " libpg_query/Makefile " ]; then
15+ echo " Initializing and fetching libpg_query submodule ..."
16+ git submodule update --init --recursive
2117else
22- echo " libpg_query already exists, updating..."
23- cd libpg_query
24- git fetch origin
25- git checkout " $LIBPG_QUERY_BRANCH "
26- git pull origin " $LIBPG_QUERY_BRANCH "
27- cd ..
18+ echo " libpg_query submodule already initialized, updating..."
19+ git submodule update --recursive
2820fi
2921
3022cd libpg_query
You can’t perform that action at this time.
0 commit comments