Sqla-raw

Latest version: v1.5.1

Safety actively analyzes 619426 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.5.1

At the moment, row handling in `sqla-raw` is not compatible with API changes in SQLAlchemy 2.x, resulting in errors on converting results to dictionaries or tuples. While we work on the transition to latest SQLA, this release pins to SQLAlchemy legacy.

1.4.0

With this version `sqla-raw` adds support for reading SQL query files from an S3 bucket, using the `s3fs` library

- `result_from_file()` can take a `s3://` URL to a specific file
- `result_by_name()` will glob through a bucket instead of a local directory if `$QUERY_PATH` in environment is a S3 bucket URL beginning with the `s3://` scheme

S3 authentication handled via boto environment variables. This usage is also described in the README.md

Local file methods continue to function in a backwards-compatible manner

1.3.0

Passing `autocommit=True` to `db.result()` (or related convenience file methods) will add that execution option to the `conn.execute()` call on the SQL text.

1.2.1

In its simplest configuration, `sqla-raw` gets a `$DATABASE_URL` from the local execution environment, and uses that as default connection string. In previous versions, the call to `os.getenv()` included in-memory SQLite database (`sqlite:///`) as a fallback default, in case the environment variable was not defined. This seemed handy and made some testing scenarios easier to provision, but could lead to confusing error messages in practice: an operator who hadn't realized that `$DATABASE_URL` was set to an expected `postgresql://...` value might be quite surprised to get SQLite syntax error exceptions when submitting SQL that's valid for Postgres but not supported in SQLite -- especially in the context of a larger program using `sqla-raw` as a library.

Better to have no default, and raise an exception specifically complaining that no database URL was specified when that's the case. That's the implementation from this release forward.

Calling this a minor update since the SQLite default was undocumented, it doesn't change the existing API meaningfully, and I doubt anyone is currently using it in a way that relies on the old default behavior.

1.1.1

Fixes a bug where appending APPLICATION_NAME to the database URL was breaking if the configured URL already had a query string in it

1.1.0

Being devoted to reducing boilerplate and convention-over-configuration as design aims, `sqla-raw` handles all Engine and connection setup by default, requiring only a `$DATABASE_URL` in the environment to begin submitting queries and getting results. That hasn't changed, but with this release it is possible to instantiate an Engine explicitly using `db.engine()`, in case you need to use multiple databases, or want to set other Engine parameters to non-default values, for example to change the `pool_size` or set `echo=True` to have it log the submitted SQL statements. Usage details in the [README](https://github.com/nerium-data/sqla-raw#sqlalchemy-engine-invocation).

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.