Repository URL to install this package:
|
Version:
3.0.0.dev3 ▾
|
| sarus_sql |
| sarus_sql.egg-info |
| MANIFEST.in |
| PKG-INFO |
| README.md |
| pyproject.toml |
| setup.cfg |
| setup.py |
Differentially private SQL
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
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
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
The mocks for the tests can be generated with python tests/ressources/generate_protos.py
This project was created with the sarus-cookiecutter version [1.0.0].