Giter Site home page Giter Site logo

jupyter-xeus / xeus-sql Goto Github PK

View Code? Open in Web Editor NEW
154.0 8.0 21.0 4.69 MB

Jupyter kernel for SQL databases

Home Page: https://xeus-sql.readthedocs.io/en/latest/

License: BSD 3-Clause "New" or "Revised" License

CMake 27.32% C++ 72.68%
sql mysql postgresql sqlite firebird odbc db2

xeus-sql's Introduction

xeus-sql

Build Status Join the chat at https://gitter.im/QuantStack/Lobby Documentation Status Binder

xeus-sql is a Jupyter kernel for general SQL implementations based on the native implementation of the Jupyter protocol xeus and SOCI, a database access library for C++.

xeus-sql screencast

Usage

Launch the Jupyter notebook with jupyter notebook or Jupyter lab with jupyter lab and launch a new SQL notebook by selecting the xsql kernel.

Note that xeus-sql support the following SQL implementations:

  • DB2
  • Firebird
  • MySQL
  • ODBC (generic backend)
  • Oracle
  • PostgreSQL
  • SQLite3

Installation

xeus-sql has been packaged for the mamba (or conda) package manager.

To ensure that the installation works, it is preferable to install xeus-sql in a fresh environment.

To ensure that the installation works, it is preferable to install xeus in a fresh environment. It is also needed to use a miniforge or miniconda installation because with the full anaconda you may have a conflict.

The safest usage is to create an environment named xeus-sql

mamba create -n xeus-sql
source activate xeus-sql

Installing from conda-forge

To install xeus-sql with the mamba (or conda) package manager:

mamba install xeus-sql jupyterlab -c conda-forge

With mamba:

mamba install xeus-sql jupyterlab -c conda-forge

Conda forge offers packaged versions for MySQL, PostgreSQL and SQLite and you can download them with: soci-mysql, soci-postgresql or soci-sqlite.

xeus-sql includes soci-core only. Which consists on the SOCI package with no DB extension attached.

Documentation

https://xeus-sql.readthedocs.io/en/latest/

Dependencies

xeus-sql depends on

xeus dependencies
xeus-sql xeus-zmq tabulate nlohmann_json xproperty xvega-bindings soci-core
master >=1.0.1, <2.0 >=1.4|>=3.0.0 >= 0.0.10, <3.10.0 >=0.11.0 >=0.0.10 >=4.0.1
0.2.1 >=1.0.1, <2.0 >=1.4|>=3.0.0 >= 0.0.10, <3.10.0 >=0.11.0 >=0.0.10 >=4.0.1
0.2.0 >=1.0.1, <2.0 >=1.4|>=3.0.0 >= 0.0.10, <3.10.0 >=0.11.0 >=0.0.10 >=4.0.1

Prior to version 0.2, xeus-sql was depending on

xeus-sql xeus tabulate nlohmann_json xproperty xvega-bindings soci-core
<=0.1.5 >=2.0.0, <3.0 >=1.4|>=3.0.0 >= 0.0.10, <3.10.0 >=0.10.4 >=0.0.10 >=4.0.1
<=0.1.2 >=1.0.0, <2.0 >=1.4|>=3.0.0 >= 0.0.10 | 4.0.1 >=0.10.4 >=0.0.10 >=4.0.1
<=0.0.6 >=0.24.0, <0.25 >=1.4|>=3.0.0 >= 0.0.5 | 4.0.1 >=0.10.4 >=0.0.3 >=4.0.1
SQL dependencies

These are optional dependencies that come by default with xeus-sql but may or may not be added to your project in case you're building manually. For more information check the CONTRIBUTING file.

xeus-sql PostgreSQL SQLite MySQL soci-sqlite, soci-postgres, soci-mysql
master >=3.30.1, <4 >=3.0.0, <4 >=1.3.0,<2.0 >=4.0.1
<=0.1.5 >=3.30.1, <4 >=3.0.0, <4 >=1.3.0,<2.0 >=4.0.1

Contributing

See CONTRIBUTING.md to know how to contribute and set up a development environment.

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.

xeus-sql's People

Contributors

derthorsten avatar isabelparedes avatar johanmabille avatar kojiromike avatar marimeireles avatar sylvaincorlay avatar wangfenjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xeus-sql's Issues

"money" column type in Postgresql generating error

Hi, I have just installed xeus-sql and am using it with Postgresql. It is generating an error when I try to access Postgresql columns of type "money" in select statements. This is the error I'm getting:

Error: unknown data type with typelem: 790 for colNum: 7 with name: budget while executing "select * from movie".

"budget" is one of the two columns in this "movie" table that are of type money. It is a small table of data about some movies that we use for teaching.

I can get around this by casting the column to numeric when I use it.

Thanks.

postgres first line comment shows no results

It seems that having a -- comment on the first line of a cell causes no result to be displayed by postgres. e.g.,

-- new query
SELECT *
FROM pg_catalog.pg_tables;

Shows no result,. but

SELECT *
FROM pg_catalog.pg_tables;
-- new query

Shows results.

Lint code

I missed out on some linting from the last few contributions.
We've been following QS's code style here, but I was wondering if this is always done by hand or do we use some linter @JohanMabille ?

Anyways, this issue is a reminder that I should fix it.

Conda installation failing for M1 Macbook

Description

I am not able to install via conda on an M1 Macbook. Seems like there is no distribution setup for osx_arm64.

conda install xeus-sql -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - xeus-sql

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

COUNT command has no output

If you do SELECT COUNT(*) FROM table1 you get count(*) as an output.
I think it's the title of a table... It's trying to create a table because the condition of the if is if has the SELECT keyword.
This was just an ugly hack to make things work fast and I didn't think on this case. This "parsing" has to be more sophisticated.

make row summary more visible

I'm a big jupyter user and really enjoy using jupyter-sql as a playground for interactively building SQL queries.

I have a small suggestion:

Currently the row summary display at the bottom of the table.
This means that you need to scroll all the way to the bottom of the table to see it. It would be much for useful if it could move to the top and display above the tabular view.

image

image

it would also be great if you could specify the height of the table that is returned, is this possible?
Ideally the tabular result of a query would automatically add a scroll bar allowing you to view all the data.

Many Thanks

Kernel crashes with `terminate called after throwing an instance of 'char const*'`

@jameshowison is using this kernel for some of his classes, connecting to postgres over localhost. However, kernels are often crashing, and looking at the logs shows this error message:

`terminate called after throwing an instance of 'char const*'``

Doesn't actually tell us what was the value of the error message, nor a traceback - which I'm guessing will help us see what is actually happening.

2i2c-org/infrastructure#968 has more context.

Remove cleaning strings functions from xeus-sql to xvega-bindings

@wangfenjin introduced a new way to clean strings and it seems better to me.

However we shouldn't have this kind of common tool inside the kernel, it should be moved to the utils.hpp file on the xvega-bindings project.

It'd probably be nice to incorporate the same changes that took place here regarding cleaning strings on xeus-sql.

Missing types convertion for PostgreSQL

Not all PostgreSQL types are covered by the switch:

Here's the warning:

2020-12-31T12:15:04.9844840Z /Users/runner/work/1/s/include/xeus-sql/soci_handler.hpp:31:27: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >::size_type' (aka 'unsigned long') [-Wsign-compare]
2020-12-31T12:15:04.9846930Z         for (int i = 2; i < tokenized_input.size(); i++)
2020-12-31T12:15:04.9847270Z                         ~ ^ ~~~~~~~~~~~~~~~~~~~~~~
2020-12-31T12:15:05.0122330Z /Users/runner/work/1/s/src/xeus_sql_interpreter.cpp:70:24: warning: enumeration values 'dt_blob' and 'dt_xml' not handled in switch [-Wswitch]
2020-12-31T12:15:05.0123010Z                 switch(props.get_data_type())
2020-12-31T12:15:05.0123320Z                        ^
2020-12-31T12:15:05.0188040Z /Users/runner/work/1/s/src/xeus_sql_interpreter.cpp:70:24: note: add missing switch cases
2020-12-31T12:15:05.0188630Z                 switch(props.get_data_type())
2020-12-31T12:15:05.0188930Z                        ^
2020-12-31T12:17:02.8016670Z 2 warnings generated.

Connecting to ODBC with %LOAD

Hello guys, I've been watching this project for a while and my only option to use this project is to connect to my DB endpoints via ODBC. Unfortunately I have seen you have no example nor documentation for that use case.

I am trying to use xeus-sql's %LOAD to connect to my ODBC driver and I am certainly doing something wrong, I would love if you can provide some help:

In [1] %LOAD odbc 'HiveANAHDSN'
Out [1] Error: Failed to find shared library for backend odbc

Note: HiveANAHDSN is the name of my ODBC driver Data Source Name (DSN)

Change date formatting to a more standard one

Hi, the formatting of the date / datetime columns in the displayed tables are offloaded to asctime() function as stated here, which displays the dates as a very non-standard way (Www Mmm dd hh:mm:ss yyyy\n),

The display can be done using strftime() instead to display these columns in an ISO compatible format (i.e yyyy-mm-dd hh:mm:ss). My C++ skills is not good enough to come up with a PR for this but I'm assuming it's not a complicated change.

Also, if SOCI supports distinguishing date and datetime columns, time display portion can be stripped from date columns as well.

Allow running multiple statements in single cell

While most basic SQL operations can be distilled to a single statement (or can be divided into multiple cells), there are times when more than one statement needs to be run in a single batch. Most obvious example is when using variables:

DECLARE @report_date DATE = '2021-02-28'

SELECT @report_date

This statement returns no output when using xeus-sql, presumably the execution ends after running the first declare statement. Splitting it into two cells don't work either as the SELECT statement fails unless the variable is declared in the same batch. The database is SQL Server and connected via Microsoft ODBC driver, but the same query runs and returns a correct result using ipython-sql or pyodbc / sqlalchemy, so the issue seems to be either with the SOCI backend, or xeus-sql implementation.

Similarly, the following query doesn't execute the INSERT part, only runs the CREATE TABLE part when run in a single cell with xeus-sql (Though executing these in two separate cells works, as they don't need to part of the same batch)

CREATE TABLE table1
(
    column1 NVARCHAR(100) NOT NULL,
    column2 FLOAT
)

INSERT INTO table1
VALUES
    ('DUMMY', 0)

Example PostgreSQL database doesn't load in Binder

From the binder link, I can't get PostgreSQL.ipynb to work as expected; when loading the database, I get Error: Failed to find shared library for backend postgresql:
image

Is it possible to make this one work with binder?

Possible to execute the 'slash' commands on postgres? \d \dt \list

Postgres uses commands starting with a \ char, but these don't seem to execute in xues-sql. e.g.,

\list

which should show all databases the user can see on the server, but it gives this error:

Error: Cannot execute query. Fatal error. ERROR:  syntax error at or near "\"
LINE 1: \list
        ^
 while executing "\list".

Same for the commonly used \d and \dt.

paging for large result sets?

I'm running into responsiveness issues with queries with many results (~100,000 order of magnitude).

If it was just me then I'd add LIMIT statements, remembering to remove them later in the query buildup. But I'm working with students and asking doesn't make it so.

Any chance that the result sets could be paged, with the interface only handling those currently being looked at? This is a common approach in things like phpmyadmin or other sql clients, but I don't know whether SOCI makes that easy or not?

About vega plot command

Hi team,

I like this project, especially the idea integrate vega into the kernel.

The command is %XVEGA_PLOT X_FIELD EmployeeId GRID false Y_FIELD ReportsTo MARK area COLOR pink WIDTH 200 HEIGHT 200 <> SELECT EmployeeId, ReportsTo FROM employees like this I think it's two complated, we need to write a lot of code to parse the user input and user need to learn new syntax.

So I suggest we follow the style I implement in here:

%VEGA-LITE specs/arc_pie.vl.json 
SELECT 
    g.Name as category, 
    SUM(il.Quantity) as b, 
    ROUND((CAST(SUM(il.Quantity) as float) / (SELECT 
        SUM(Quantity) total
    FROM Chinook.InvoiceLine il
    INNER JOIN Chinook.Invoice i ON i.InvoiceId = il.InvoiceId
    WHERE i.BillingCountry = 'USA')) * 100, 2) value 
FROM Chinook.InvoiceLine il
INNER JOIN Chinook.Invoice i ON i.InvoiceId = il.InvoiceId 
INNER JOIN Chinook.Track t ON il.TrackId = t.TrackId 
INNER JOIN Chinook.Genre g ON t.GenreId = g.GenreId 
WHERE i.BillingCountry = 'USA' 
GROUP BY 1 
ORDER BY 2 DESC
LIMIT 10

This is a project I fork from this repo to verify my ideas and used to participants a hackathon, but I would like to contribute back and archive my repo.

And if we want to support define specs on the fly, and can add some command like:

%VEGA-LITE SET my_spec.vl.json
{
  "data": {"url": "data/seattle-weather.csv"},
  "mark": "bar",
  "encoding": {
    "x": {"timeUnit": "month", "field": "date", "type": "ordinal"},
    "y": {"aggregate": "mean", "field": "precipitation"}
  }
}

%VEGA-LITE PLOT my_spec.vl.json
select ...

What do you think?

Jupyter console not showing tables output

image

I wonder if it's somehow related with xvega, because afai can remember it used to work in xeus-sqlite before the integration with xvega. But I don't really know, I investigated this issue before and it doesn't seem to be related to terminals.

My fallback plan was to do a binary search on the commits and see when the breaking change happened. This probably has to be done on xeus-sqlite though.

Handle postgres datatype xid? query returns Error: unknown data type with typelem: 28

While creating a sample query I tried to list databases using a SELECT query, running into:

Error: unknown data type with typelem: 28 for colNum: 10 with name: datfrozenxid while executing "SELECT *
FROM pg_database;".

running

SELECT *
FROM pg_database

In terminal that table has this description; it seems the xid column type is the issue?

# \d pg_database
               Table "pg_catalog.pg_database"
    Column     |   Type    | Collation | Nullable | Default 
---------------+-----------+-----------+----------+---------
 datname       | name      |           | not null | 
 datdba        | oid       |           | not null | 
 encoding      | integer   |           | not null | 
 datcollate    | name      |           | not null | 
 datctype      | name      |           | not null | 
 datistemplate | boolean   |           | not null | 
 datallowconn  | boolean   |           | not null | 
 datconnlimit  | integer   |           | not null | 
 datlastsysoid | oid       |           | not null | 
 datfrozenxid  | xid       |           | not null | 
 datminmxid    | xid       |           | not null | 
 dattablespace | oid       |           | not null | 
 datacl        | aclitem[] |           |          | 
Indexes:
    "pg_database_datname_index" UNIQUE, btree (datname), tablespace "pg_global"
    "pg_database_oid_index" UNIQUE, btree (oid), tablespace "pg_global"
Tablespace: "pg_global"

%XVEGA_PLOT and sql statement on new line: <> needs a space after to make it work

Currently, putting the select statement on the next line is a bit strange. e.g. neither of the following two cells work:

%XVEGA_PLOT X_FIELD x Y_FIELD y MARK line COLOR purple WIDTH 400 HEIGHT 200 <>
Select *
FROM (VALUES (1,1), (2,2)) t(x,y)
%XVEGA_PLOT X_FIELD x Y_FIELD y MARK line COLOR purple WIDTH 400 HEIGHT 200
Select *
FROM (VALUES (1,1), (2,2)) t(x,y)

Error both times: Error: cannot create std::vector larger than max_size()

Funnily, this works:

%XVEGA_PLOT X_FIELD x Y_FIELD y MARK line COLOR purple WIDTH 400 HEIGHT 200 <> 
Select *
FROM (VALUES (1,1), (2,2)) t(x,y)

-> Difference: a space after <>...

postgresql: TRUE/FALSE display as 1/0

Using

%LOAD postgresql dbname=postgres host=localhost
Select FALSE as bar;

I get a display of

bar
0

Which looks wrong to my eyes which are used to normal psql output. If this has to be fixed deeper, I can also open a ticket in soci...

Binder is not working

Looking for: ['xeus-sqlite=0.1.0']


bash: line 1:     8 Segmentation fault      (core dumped) ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml"
time: 30.723

Display number of results at top of output, rather than bottom?

When writing queries it's often useful to get a feel for the number of results (without specifically writing a COUNT(*) bit). Currently the number of rows is at the bottom which means lots of scrolling to see (for any decent size of results).

Could the number of results line come at the top? (That would also combine well with paging results :)

Support for bash, other magic?

Hey y'all, I started using xeus-sql and it's fantastic, I love the interface for querying data, it feels way more jupyter-native, it's great

I was planning to use it for teaching, and I wanted to build a nice SQLite notebook which had everything the students would need, but I'm struggling with some limitations of our platform which makes it difficult to distribute more than just the notebook file. Normally I'd just add a bash magic for ! wget https://../db.sqlite at the start to do setup, but it seems those aren't implemented yet.

Is such a thing on the roadmap? I think it'd be useful to show off some database specific commands to students when needed, or run 'backup' commands.

If not, no worries, just wanted to check if that was in the plan or if I should just switch to https://github.com/catherinedevlin/ipython-sql

How do I set up a Jupyter kernelspec for Xeus-SQL?

I want to try the Xeus-SQL kernel in my project's Mamba environment, but also use a centrally-installed Jupyter instance such as Jupyter Desktop.

However, I don't see any instructions for setting this up using jupyter kernelspec install or any other mechanism.

Is this a supported mode of operation? If so, what are the correct steps? Or if I need to set up the Kernel JSON manually, what should I put in it?

Doesn't build. json == 3.11.2 ?

Hello,
I try to build xeus-sql 0.2.0, but it fails with undefined references:

/usr/bin/ld: CMakeFiles/xeus-sql.dir/src/xeus_sql_interpreter.cpp.o: in function `xv::detail::xany_owning<xv::mark, xv::mark_tick>::to_json(nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&) const':
/usr/include/xvega/utils/xany.hpp:151: undefined reference to `xv::to_json(nlohmann::json_abi_v3_11_2::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, xv::mark_tick const&)'

and more.
Here the versions detected:

-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building xeus-sql v0.2.0
-- Found nlohmann_json: /usr/share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.11.2", minimum required is "3.2.0") 
-- Found LibUUID: /usr/lib64/libuuid.so  
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "3.0.5")  
-- Found nlohmann_json: /usr/share/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.11.2", minimum required is "3.7.3") 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Soci found: Looking for plugins
--     * Plugin mysql not found.
--     * Plugin odbc not found.
--     * Plugin postgresql not found.
--     * Plugin sqlite3 not found.
-- Found Soci: /usr/include/soci  
-- Found PostgreSQL: /usr/lib64/libpq.so (found version "13.9")  
-- Found SQLite3: /usr/include (found version "3.40.0") 
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Configuring done
-- Generating done

I see now that recommended json is <3.10.0
Is it any hope?

Add autocompletion for generic SQL commands

So, there are prbb a lot of specific commands to each backend... But maybe we could offer autocompletion for the ones who are common between them all?
Is there a big intersection here?

See docs
& example

For implementing something like this.

Dev instruction problems

Running the requested lines to setup a dev environment (https://github.com/jupyter-xeus/xeus-sql/blob/master/CONTRIBUTING.md) on a mac osx install (with micromamba instead of conda/mamba) results in this:

~/external/xeus-sql/build on master (conda:xeus-sql)
[22:14:01] λ  cmake -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
-- Building xeus-sql v0.0.3
-- Found nlohmann_json: /Users/jan.katins/.local/micromamba/envs/xeus-sql/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.9.1", minimum required is "3.2.0")
-- Found nlohmann_json: /Users/jan.katins/.local/micromamba/envs/xeus-sql/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.9.1", minimum required is "3.7.3")
-- Soci found: Looking for plugins
--     * Plugin mysql not found.
--     * Plugin odbc not found.
--     * Plugin postgresql not found.
--     * Plugin sqlite3 found /Users/jan.katins/.local/micromamba/envs/xeus-sql/lib/libsoci_sqlite3.dylib.
CMake Error at CMakeLists.txt:141 (message):
  Unsupported compiler -- xeus-sql requires C++14 support!
Call Stack (most recent call first):
  CMakeLists.txt:198 (xsql_set_common_options)
  CMakeLists.txt:239 (xsql_create_target)


-- Configuring incomplete, errors occurred!
See also "/Users/jan.katins/external/xeus-sql/build/CMakeFiles/CMakeOutput.log".
See also "/Users/jan.katins/external/xeus-sql/build/CMakeFiles/CMakeError.log".

I tried to work around that check (assuming my clang supports c++14) by

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09bc890..0738e8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,12 +134,7 @@ macro(xsql_set_common_options target_name)
         endif ()

         # C++14 flag
-        CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)
-        if (HAS_CPP14_FLAG)
-            target_compile_features(${target_name} PRIVATE cxx_std_14)
-        else ()
-            message(FATAL_ERROR "Unsupported compiler -- xeus-sql requires C++14 support!")
-        endif ()
+        target_compile_features(${target_name} PRIVATE cxx_std_14)

         # Enable link time optimization and set the default symbol
         # visibility to hidden (very important to obtain small binaries)

But this failed then in make:

...
Scanning dependencies of target xeus-sql
[ 50%] Building CXX object CMakeFiles/xeus-sql.dir/src/xeus_sql_interpreter.cpp.o
In file included from /Users/jan.katins/external/xeus-sql/src/xeus_sql_interpreter.cpp:24:
/Users/jan.katins/external/xeus-sql/include/xeus-sql/soci_handler.hpp:31:27: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>::size_type' (aka 'unsigned long') [-Wsign-compare]
        for (int i = 2; i < tokenized_input.size(); i++)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~
/Users/jan.katins/external/xeus-sql/src/xeus_sql_interpreter.cpp:70:24: warning: enumeration values 'dt_blob' and 'dt_xml' not handled in switch [-Wswitch]
                switch(props.get_data_type())
                       ^
2 warnings generated.
[ 66%] Linking CXX shared library libxeus-sql.dylib
ld: warning: -pie being ignored. It is only used when linking a main executable
[ 66%] Built target xeus-sql
Scanning dependencies of target xsql
[ 83%] Building CXX object CMakeFiles/xsql.dir/src/main.cpp.o
[100%] Linking CXX executable xsql
ld: unknown option: --disable-new-dtags
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [xsql] Error 1
make[1]: *** [CMakeFiles/xsql.dir/all] Error 2
make: *** [all] Error 2

Add syntax completion to SQL

Thorsten lovely added syntax completion for SQLite and I think we could do something very similar to his PR on xeus-SQL. We just need to make sure the keywords are universal, I guess, because otherwise it will recommend invalid words for invalid sub SQL languages.

This is a good issue for someone who'd like to contribute for the first time, let me know if you have any questions.

Add tests to xeus-sql

There are two kinds of tests I'd like to add here:

Notebook tests to xeus-sql

It's not very easy to setup an instance of working jupyter notebooks on CI -because of the many integrations, but we can do it for sqlite. Here is an example of what I'd like to have.

GTEST

We have everything setup to build and run gtests on our cmake we just need to build them. The biggest the coverage the better, feel free to add a list here or contribute with any tests! :)

I'll try to add some slowly but I'll gladly review PRs! Thanks! 🌸

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.