Thank you for contributing to MyDuck Server! This guide will help you set up the development environment and run the server.
Before getting started, ensure that the following dependencies are installed:
-
Go
Download and install the latest version of Go by following the official installation guide. -
Python and
sqlglot[rs]
package
MyDuck Server depends on thesqlglot[rs]
package, which can be installed usingpip3
. You have two options for installation:-
Global installation (use with caution as it may affect system packages):
pip3 install "sqlglot[rs]" --break-system-packages
-
Installation inside a virtual environment (recommended):
mkdir -p ~/venv python3 -m venv ~/venv/myduck source ~/venv/myduck/bin/activate pip3 install "sqlglot[rs]"
Make sure to activate the virtual environment when you work on the project:
source ~/venv/myduck/bin/activate
-
To build MyDuck Server, run the following command:
go get -v
go build -v
This will compile the necessary files.
Once built, run the server:
make run
-
Using MySQL Client:
In another terminal window, connect to the MyDuck Server using the MySQL client with the following command:mysql -h127.0.0.1 -uroot -P3306
-
Using PostgreSQL Client:
If you prefer to use a Postgres client, connect using the following command:psql -h 127.0.0.1 -p 5432 -U postgres
- Ensure that you have all the necessary permissions for the system dependencies (e.g.,
pip3
installation with--break-system-packages
). - The
make
tool is required to build and run the project. If it's not already installed, you can install it via your package manager (e.g.,brew install make
on macOS). - If you run into any issues or need help, feel free to open an issue or reach out to the community.