Skip to content

leissa/sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

111 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL

A small SQL parser.

Building

If you have a GitHub account setup with SSH, just do this:

git clone --recurse-submodules git@github.com:leissa/sql.git

Otherwise, clone via HTTPS:

git clone --recurse-submodules https://github.com/leissa/sql.git

Then, build with:

cd sql
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j $(nproc)

For a Release build simply use -DCMAKE_BUILD_TYPE=Release.

Test:

 ./build/bin/sql -d test/select.sql

Coding Style

Use the following coding conventions:

  • class/type names in CamelCase
  • constants as defined in an enum or via static const in Camel_Snake_Case
  • macro names in SNAKE_IN_ALL_CAPS
  • everything else like variables, functions, etc. in snake_case
  • use a trailing underscore suffix for a private_or_protected_member_variable_
  • don't do that for a public_member_variable
  • use struct for plain old data
  • use class for everything else
  • visibility groups in this order:
    1. public
    2. protected
    3. private
  • prefer // C++-style comments over /* C-style comments */
  • use /// three slashes for Doxygen and group your methods into logical units if possible
  • use Markdown-style Doxygen comments
  • methods/functions that return a bool should be prefixed with is_
  • methods/functions that return a std::optional or a pointer that may be nullptr should be prefixed with isa_

For all the other minute details like indentation width etc. use clang-format and the provided .clang-format file in the root of the repository. In order to run clang-format automatically on all changed files, switch to the provided pre-commit hook:

git config --local core.hooksPath .githooks/

Note that you can disable clang-format for a piece of code. In addition, you might want to check out plugins like the Vim integration.

About

Small and simple SQL parser

Topics

Resources

License

Stars

2 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors