• Stars
    star
    725
  • Rank 62,504 (Top 2 %)
  • Language
    C++
  • License
    MIT License
  • Created about 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SQL Parser for C++. Building C++ object structure from SQL statements.

C++ SQL Parser

Build Status

This is a SQL Parser for C++. It parses the given SQL query into C++ objects. It has been developed for integration in Hyrise, but can be used perfectly well in other environments as well.

In March 2015 we've also written a short paper outlining discussing some development details and the integration into our database Hyrise. You can find the paper here.

Usage

Note: You can also find a detailed usage description here.

To use the SQL parser in your own projects you simply have to follow these few steps.

  1. Download the latest release here
  2. Compile the library make to create libsqlparser.so
  3. (Optional, Recommended) Run make install to copy the library to /usr/local/lib/
  4. Run the tests make test to make sure everything worked
  5. Include the SQLParser.h from src/ (or from /usr/local/lib/hsql/ if you installed it) and link the library in your project
  6. Take a look at the example project here
#include "hsql/SQLParser.h"

/* ... */

{
    // Basic Usage Example

    const std::string query = "...";
    hsql::SQLParserResult result;
    hsql::SQLParser::parse(query, &result);

    if (result.isValid() && result.size() > 0) {
        const hsql::SQLStatement* statement = result.getStatement(0);

        if (statement->isType(hsql::kStmtSelect)) {
            const auto* select = static_cast<const hsql::SelectStatement*>(statement);
            /* ... */
        }
    }
}

Quick Links:

How to Contribute

Developer Documentation

We strongly encourage you to contribute to this project! If you want to contribute to this project there are several options. If you've noticed a bug or would like an improvement let us know by creating a new issue. If you want to develop a new feature yourself or just improve the quality of the system, feel free to fork the reposistory and implement your changes. Open a pull request as soon as your done and we will look over it. If we think it's good then your pull request will be merged into this repository.

License

HYRISE sql-parser is licensed as open source after the MIT License which is declared in the LICENSE file of this project.

More Repositories

1

hyrise

Hyrise is a research in-memory database.
C++
798
star
2

hyrise-v1

HYRISE In-Memory Hybrid Storage Engine (archived, now developed in hyrise/hyrise repo)
C++
89
star
3

index_selection_evaluation

Platform to evaluate index selection algorithms
Python
82
star
4

rl_index_selection

Paper repository for "SWIRL: Selection of Workload-aware Indexes using Reinforcement Learning" (EDBT 2022)
Python
28
star
5

nvm_malloc

C
24
star
6

Cockpit

A Cockpit for Self-Driving Databases.
Python
15
star
7

encoding_selection

Paper repository for "Robust and Budget-Constrained Encoding Configurations for In-Memory Database Systems" (VLDB 2022)
Python
7
star
8

sub-cache-line-access

A modification to Intel's Pin Tool that tracks cache line utilization
C++
6
star
9

bencho

A C++ benchmarking framework.
C++
6
star
10

tpch_paper

Online Resources for the Paper 'Quantifying TPC-H Choke Points and Their Optimizations'
6
star
11

replication

Python
4
star
12

dispatcher

Simple Query dispatcher for distributed Hyrise cluster
C++
3
star
13

fused_table_scans

Fused Table Scans as described in our 2017 HardBD/Active paper
C++
3
star
14

ftprinter

C++
2
star
15

benchosample

A sample benchmark using the bencho framework.
C++
2
star
16

benchmark

Hyrise Benchmark Enviroment
Python
2
star
17

self_driving_tune_multiple_features

LPs for the paper Self-Driving Database Systems: A Conceptual Approach
2
star
18

example_plugin

An example plugin for the In-Memory Database System Hyrise
CMake
2
star
19

index_selection_icde19

Efficient Scalable Multi-Attribute Index Selection Using Recursive Strategies
2
star
20

table_configuration_optimizer

Paper repository for "Budget-Conscious Fine-Grained Configuration Optimization for Spatio-Temporal Applications" (VLDB 2022)
Jupyter Notebook
2
star
21

DYOD_SoSe21

C++
1
star
22

DYOD_SoSe23

C++
1
star
23

hyrise_extensions

extension template for hyrise/extensions
1
star
24

hyrise_visualizer

Front-End for the HYRISE Database based on JS and Ruby
JavaScript
1
star
25

benchmark_deprecated

Python
1
star
26

hyrise_jdbc

HYRISE JDBC Class 3/4 Driver
Java
1
star
27

hyrise_puppet

HYRISE puppet configuration
Ruby
1
star