Git Product home page Git Product logo

worldql_server's Introduction

WorldQL Server Build Docker Build Discord

Rust implementation of the WorldQL server.

Running WorldQL

To run WorldQL you will first need the executable binary. The easiest way is by using the pre-built binaries available on this repo's GitHub Actions tab. Click on a workflow run and scroll to the bottom and you will find build artifacts containing the pre-built binary.

If you want to build from source, for example if building for a platform not supported by CI, then follow the setup instructions below. Make sure to build in release mode, as Rust will optimise the final binary and you should get greater performance. To build in release mode use cargo build --release, and the resulting binary will end up in the target/release directory.

Setup Instructions

⚠️ This project cannot be built on Windows due to the ZeroMQ library only supporting UNIX-based operating systems. See this issue for more information.

These instructions assume you are using a Debian-based Linux (or WSL) distro, such as Ubuntu. If using WSL, make sure you are using WSL2, as WSL1 has compatibility issues and may not work as expected.

First, install dependency packages for the Rust toolchains.

$ sudo apt-get install -y curl build-essential cmake

Next you will need to install Rust, the easiest way is by using Rustup.

Cloning the Project

If using WSL, ensure you clone the project inside the WSL filesystem. If you use the Windows filesystem (any paths starting with /mnt) then you may experience slower compile times.

Building and Running

The project is managed by Rust's package manager and build tool, Cargo, and should come preinstalled with Rust.

To build the project, simply run cargo build in the project's root directory.
To build and run in a single command, you can use cargo run. To pass WorldQL CLI flags to cargo run, use cargo run -- <...flags>

# Example using cargo run
$ cargo run -- --psql "hostname=localhost user=user password=secret"

WorldQL is configured either using environment variables or CLI flags. Run with --help to list flags and their associated environment variables. Note that CLI flags will always take priority.

Using VSCode

Ensure you have the Rust Analyzer extension for excellent Rust language support. If using WSL, you will also need the Remote - WSL extension to be able to open the project from within the WSL filesystem.

Using CLion

Simply open the project after installing the Rust plugin and everything should work correctly; you will only need to change one setting. Under Languages & Frameworks > Rust > rustfmt ensure Use rustfmt instead of built-in formatter is checked.

Viewing Documentation

The best documentation available is our hand-written docs site, available at https://docs.worldql.com/, or view the source at WorldQL/docs.worldql.com

You can also view the project's auto-generated Rustdoc documentation by running the ./view_documentation.sh script, located in the project's root directory.

Formatting and Linting

WorldQL uses rustfmt for formatting and Clippy for linting. Both come as standard with a Rustup toolchain installation, but if you don't have them you can simply use Rustup to install them. Note that the current rustfmt formatting rules requires the use of Rust nightly.

# Install Rustup (requires nightly toolchain)
rustup toolchain install nightly
rustup component add rustfmt --toolchain nightly

# Install Clippy
rustup component add clippy

Once both are installed, simply run cargo +nightly fmt --verbose to apply formatting and cargo clippy to lint. GitHub Actions CI runs both formatting and linting checks on pushes to trunk and for any pull requests to ensure standard formatting and catch lint failures.

⚠️ New docs coming soon!

worldql_server's People

Contributors

jaxkr avatar luludotdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.