Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  sarus_sql
  sarus_sql.egg-info
  MANIFEST.in
  PKG-INFO
  README.md
  pyproject.toml
  setup.cfg
  setup.py
Size: Mime:
  README.md

sarus-sql

Differentially private SQL

Installation

To start using sarus_sql,

    apt-get update
    apt-get install -y protobuf-compiler build-essential
    pip install mypy-protobuf pytest
    pip install --extra-index-url=https://${FURY_AUTH}:@pypi.fury.io/sarus/ .
    make

Example with postgres

export PGPASSWORD=1234
pip install psycopg2
docker run --name some-postgres -e POSTGRES_PASSWORD=$PGPASSWORD -d postgres
docker cp tests/ressources some-postgres:.
docker exec some-postgres psql -U postgres -h localhost -p 5432 -f tests/ressources/test_database/install_postgres.sql
python examples/test_queries.py -e postgres

Example with mssql

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Pass1234" -p 1433:1433 --name some-mssql -d mcr.microsoft.com/mssql/server:2019-CU13-ubuntu-20.04

Copy the files. Do not copy them in the root directory to avoid the file access right issu. (https://stackoverflow.com/questions/59013661/cannot-bulk-load-the-file-does-not-exist-or-you-dont-have-file-access-rights)

docker cp tests/ressources/test_database some-mssql:/tmp

Install the db

docker exec some-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pass1234 -i tmp/test_database/install_mssql.sql

docker exec some-mssql  /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pass1234 -d "test_database" -q "BULK INSERT census FROM '/tmp/test_database/extract_census.csv' WITH (FORMAT='CSV',FIRSTROW = 2, FIELDTERMINATOR=',', ROWTERMINATOR='\n', TABLOCK);"

docker exec some-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pass1234 -d "test_database" -q "BULK INSERT beacon FROM '/tmp/test_database/extract_beacon.csv' WITH (FORMAT='CSV',FIRSTROW = 1, FIELDTERMINATOR=',', ROWTERMINATOR='\n', TABLOCK);"

docker exec some-mssql  /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pass1234 -d "test_database_synth" -q "BULK INSERT census_synth FROM '/tmp/test_database/extract_census.csv' WITH (FORMAT='CSV',FIRSTROW = 2, FIELDTERMINATOR=',', ROWTERMINATOR='\n', TABLOCK);"

docker exec some-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Pass1234 -d "test_database_synth" -q "BULK INSERT beacon_synth FROM '/tmp/test_database/extract_beacon.csv' WITH (FORMAT='CSV',FIRSTROW = 1, FIELDTERMINATOR=',', ROWTERMINATOR='\n', TABLOCK);"

python examples/test_queries.py -e mssql

Tests

The mocks for the tests can be generated with python tests/ressources/generate_protos.py

Quickstart

Project status

Current features

Known limitations / Bugs

Acknowledgements

Contributors

Miscellaneous

This project was created with the sarus-cookiecutter version [1.0.0].