- BREAKING CHANGE: The SQLAlchemy dialect has been split off into the sqlalchemy-cratedb package, see notice below.
- Feature: Returned Python
datetime
objects are now always timezone-aware, using UTC by default. It may be a breaking change for some users of the library that don't expect to receive "aware" instead of "naive" Pythondatetime
objects from now on, i.e. instances with or without thetzinfo
attribute set. When notime_zone
information is specified when creating a database connection or cursor,datetime
objects will now use Coordinated Universal Time (UTC), like CrateDB is storing timestamp values in this format. This update is coming from a deprecation of Python'sdatetime.utcfromtimestamp()
, which is effectively also phasing out the use of "naive" timestamp objects in Python, in favor of using timezone-aware objects, also to represent datetimes in UTC. - Feature: Configured DB API interface attribute
threadsafety = 1
, which signals "Threads may share the module, but not connections." - Feature: Added
error_trace
to string representation of an Error, to relay server stacktraces into exception messages. - Refactoring: The module namespace
crate.client.test_util
has been renamed tocrate.testing.util
. - Error handling: At two spots in cursor / value converter handling, where
assert
statements have been used,ValueError
exceptions are raised now. - Python: Migrated to use "implicit namespace packages" instead of "declared
namespaces" for the
crate
namespace package, see PEP 420.
Note
For learning about the transition to sqlalchemy-cratedb, we recommend to read the enumeration of necessary migration steps at Migrate from crate.client to sqlalchemy-cratedb.
- Test compatibility: Permit installation of pandas 2.1.
- Compatibility: Re-add
crate.client._pep440.Version
fromverlib2
. It is needed the prevent breakingcrash
.
- Permit
urllib3.Timeout
instances for defining timeout values. This way, bothconnect
andread
socket timeout settings can be configured. The unit is seconds.
- Properly handle Python-native UUID types in SQL parameters. Thanks, @SStorm.
- SQLAlchemy: Fix handling URL parameters
timeout
andpool_size
- Permit installation with urllib3 v2, see also urllib3 v2.0 roadmap
and urllib3 v2.0 migration guide. You can optionally retain support
for TLS 1.0 and TLS 1.1, but a few other outdated use-cases of X.509
certificate details are immanent, like no longer accepting the long
deprecated
commonName
attribute. Instead, going forward, only thesubjectAltName
attribute will be used. - SQLAlchemy: Improve DDL compiler to ignore foreign key and uniqueness constraints.
- DBAPI: Properly raise
IntegrityError
exceptions instead ofProgrammingError
, when CrateDB raises aDuplicateKeyException
. - SQLAlchemy: Ignore SQL's
FOR UPDATE
clause. Thanks, @surister.
- SQLAlchemy: Rename leftover occurrences of
Object
. The new symbol to represent CrateDB'sOBJECT
column type is nowObjectType
. - SQLAlchemy DQL: Use CrateDB's native
ILIKE
operator instead of using SA's generic implementationlower() LIKE lower()
. Thanks, @hlcianfagna.
- SQLAlchemy DDL: Allow turning off column store using
crate_columnstore=False
. Thanks, @fetzerms. - SQLAlchemy DDL: Allow setting
server_default
on columns to enable server-generated defaults. Thanks, @JanLikar. - Allow handling datetime values tagged with time zone info when inserting or updating.
- SQLAlchemy: Fix SQL statement caching for CrateDB's
OBJECT
type. Thanks, @faymarie. - SQLAlchemy: Refactor
OBJECT
type to use SQLAlchemy's JSON type infrastructure. - SQLAlchemy: Added
insert_bulk
fast-pathINSERT
method for pandas, in order to support efficient batch inserts using CrateDB's "bulk operations" endpoint. - SQLAlchemy: Add documentation and software tests for usage with Dask
- SQLAlchemy Core: Re-enable support for
INSERT/UPDATE...RETURNING
in SQLAlchemy 2.0 by adding the newinsert_returning
andupdate_returning
flags in the CrateDB dialect.
- SQLAlchemy Core: Support
INSERT...VALUES
with multiple value sets by enablingsupports_multivalues_insert
on the CrateDB dialect, it is used by pandas'method="multi"
option - SQLAlchemy Core: Enable the
insertmanyvalues
feature, which lets you control the batch size ofINSERT
operations using theinsertmanyvalues_page_size
engine-, connection-, and statement-options. - SQLAlchemy ORM: Remove support for the legacy
session.bulk_save_objects
API on SQLAlchemy 2.0, in favor of the newinsertmanyvalues
feature. Performance optimizations frombulk_save()
have been made inherently part ofadd_all()
. Note: The legacy mode will still work on SQLAlchemy 1.x, while SQLAlchemy 2.x users MUST switch to the new method now.
- Fixed SQLAlchemy 2.0 incompatibility with
CrateDialect.{has_schema,has_table}
- Added deprecation warning about dropping support for SQLAlchemy 1.3 soon, it is effectively EOL.
- Added support for SQLAlchemy 2.0. See also What's New in SQLAlchemy 2.0 and SQLAlchemy 2.0 migration guide.
- Updated to geojson 3.0.0.
- SQLAlchemy: Added support for
crate_index
andnullable
attributes in ORM column definitions. - Added support for converting
TIMESTAMP
columns to timezone-awaredatetime
objects, using the newtime_zone
keyword argument.
- Added a generic data type converter to the
Cursor
object, for converting fetched data from CrateDB data types to Python data types. - Fixed generating appropriate syntax for OFFSET/LIMIT clauses. It was possible
that SQL statement clauses like
LIMIT -1
could have been generated. Both PostgreSQL and CrateDB only acceptLIMIT ALL
instead. - Added support for computed columns in the SQLAlchemy ORM
- Improved SQLAlchemy's
CrateDialect.get_pk_constraint
to be compatible with breaking changes in CrateDB >=5.1.0.
- Fixed regression introduced by
0.27.0
resulting in unavailable servers if all configured servers aren't reachable once.
- Added support for Python 3.9 and 3.10.
- Dropped support for Python 3.4, 3.5 and 3.6.
- Dropped support for SQLAlchemy 1.1 and 1.2.
- Dropped support for CrateDB < 2.0.0.
- BREAKING CHANGE: The driver now verifies SSL certificates when connecting via
HTTP by default. Previously, this setting defaulted to false. This setting
can be changed via the
verify_ssl_cert
connection parameter. - Adjusted connect arguments to accept credentials within the HTTP URI.
- Added support for enabling SSL using SQLAlchemy DB URI with parameter
?ssl=true
. - Added support for SQLAlchemy 1.4
Note
For learning about the transition to SQLAlchemy 1.4, we recommend the corresponding documentation What’s New in SQLAlchemy 1.4?.
SQLAlchemy 1.4 became stricter on some details. It requires to wrap CrateDB
system columns like _score
in a SQLAlchemy literal_column type.
Before, it was possible to use a query like this:
session.query(Character.name, '_score')
It must now be written like:
session.query(Character.name, sa.literal_column('_score'))
Otherwise, SQLAlchemy will complain like:
sqlalchemy.exc.ArgumentError: Textual column expression '_score' should be explicitly declared with text('_score'), or use column('_score') for more specificity
- Enabled TCP keepalive on socket level and support for setting socket options
when creating the connection. The supported options are:
TCP_KEEPIDLE
(overridingnet.ipv4.tcp_keepalive_time
)TCP_KEEPINTVL
(overridingnet.ipv4.tcp_keepalive_intvl
)TCP_KEEPCNT
(overridingnet.ipv4.tcp_keepalive_probes
)
- Propagate connect parameter
pool_size
to urllib3 asmaxsize
parameter in order to make the connection pool size configurable.
- Added support for the
RETURNING
clause to the SQLAlchemy dialect. This requires CrateDB 4.2 or greater. In case you use any server side generated columns in your primary key constraint with earlier CrateDB versions, you can turn this feature off by passingimplicit_returning=False
in thecreate_engine()
call. - Added support for
geo_point
andgeo_json
types to the SQLAlchemy dialect.
- Upgraded SQLAlchemy support to 1.3.
- Added
backoff_factor
in connection to configure retry interval. - Added official Python 3.8 support.
- Made it so that the SQLAlchemy dialect is now aware of the return type of the
date_trunc
function. - Added driver attribute, as SQLAlchemy relies on interfaces having that string for identification.
- Fixed a bug in the
CrateLayer
which causedCrateDB
not to start up, in case theJAVA_HOME
environment variable was not set.
- Extended the type mapping for SQLAlchemy for the upcoming type name changes in CrateDB 4.0.
- Added support for Python 3.7 and made that version the recommended one.
- Fixed a resource leak in
CrateLayer
- Added ability to specify chunk size when getting a blob from the blob container
- Client no longer removes servers from the active server list when encountering a connection reset or a broken pipe error.
- BREAKING: Dropped support for Python 2.7 and 3.3 If you are using this package with Python 2.7 or 3.3 already, you will not be able to install newer versions of this package.
- Add support for SQLAlchemy 1.2
- The client now allows to define a different default schema when connecting to
CrateDB with the
schema
keyword argument. This causes all statements and queries that do not specify a schema explicitly to use the provided schema. - Updated
get_table_names()
method in SQLAlchemy dialect to only return tables but not views. This enables compatibility with CrateDB 3.0 and newer.
- Fixed an issue that caused
metadata.create_all(bind=engine)
to fail creating tables that contain anObjectArray
column.
- BREAKING: In the testing layer, the custom setting of cluster.routing.allocation.disk.watermark.low (1b) and cluster.routing.allocation.disk.watermark.high (1b) has been removed. These now default to 85% and 90%, respectively.
- Fixed an issue that prevented the usage of SQLAlchemy types
NUMERIC
andDECIMAL
as column types.
- Added new parameter
password
used to authenticate the user in CrateDB. - Prepared SQL Alchemy primary key retrieval for CrateDB 2.3.0. Preserved backwards-compatibility for lower versions.
- Fixed deprecation warnings logged in CrateDB server on every REST request.
- Added new parameter
username
used to authenticate the user in CrateDB.
- Enforced cert check when verify_ssl_cert=True
- Testing: Fixed issue that caused the test layer to hang after it failed to start a CrateDB instance in time.
- Fix bulk updates which were broken due to query rewrites.
- Output logs in test-layer in case when CrateDB instance does not start in time.
- Increased the default timeout for the test-layer startup to avoid timeouts on slow hosts.
- Testing: Prevent the process.stdout buffer from filling up in the test layer which in turn would cause the process to block
- Raise more meaningful BlobLocationNotFoundException error when trying to upload a file to an invalid blob table.
- Testing: Added support for setting environment variables.
- BREAKING: Dropped Crate version < 1.0.0 support for Crate test layer
- Testing: Dropped
multicast
support for Crate test layer - Added support for
Insert
from select to the SQLAlchemy dialect - sqlalchemy: support get_columns and get_pk_constraint
- Testing: Dropped
- BREAKING: Dropped support for SQLAlchemy < 1.0.0
- Fix sqlalchemy: crate dialect didn't work properly with alpha and beta versions of sqlalchemy due to a wrong version check (e.g.: sandman2 depends on 1.1.0b3)
- sqlalchemy: added support for native Arrays
- Fix sqlalchemy:
sa.inspect(engine).get_table_names
failed due to an attribute error
- Added compatibility for SQLAlchemy version 1.1
- Fix sqlalchemy: updates in nested object columns have been ignored
- Fix: Avoid invalid keyword argument error when fetching blobs from cluster by removing certificate keywords before creating non-https server in pool.
- Testing: Made Crate test layer logging less verbose (hide Crate startup logs)
and added
verbose keyword
argument to layer to control its verbosity.
- Increased
urllib3
version requirement to >=1.9 to prevent from compatibility issues. - Testing: Do not rely on startup log if static http port is defined in test layer.
- Fix:
Date
column type is now correctly created asTIMESTAMP
column when creating the table
- Added a
from_uri
factory method to theCrateLayer
- The
Connection
class now supports the context management protocol and can therefore be used with thewith
statement. - Sockets are now properly closed if a connection is closed.
- Added support for serialization of Decimals
- Added support for client certificates
- Dropped support for Python 2.6
- Fix: Never retry on http read errors (so never send SQL statements twice)
- test-layer: Removed options that are going to be removed from Crate
- Added support for serialization of date and datetime objects
- fix in crate test layer: wait for layer to completely start up node
- fix: use proper CLUSTERED clause syntax in SQLAlchemy's create table statement
- Fix urllib3 error with invalid kwargs for
HTTPConnectionPool
whenREQUESTS_CA_BUNDLE
is set
- Fix: allow ObjectArrays to be set to None
- wait until master of test cluster is elected before starting tests
- fixed compatibility issues with SQLAlchemy 1.0.x
- map SQLAlchemy's text column type to Crate's
STRING
type
- add support for table creation using the SQLAlchemy ORM functionality.
- fix: match predicate now properly handles term literal
- changed SQLAlchemy update statement generation to be compatible with crate 0.47.X
- added missing functionality in CrateDialect, containing: default schema name, server version info, check if table/schema exists, list all tables/schemas
- updated crate to version 0.46.1
- support iterator protocol on cursor
- added match predicate in sqlalchemy to support fulltext search
- send application/json Accept header when requesting crate
- add new options to CrateLayer in order to build test clusters
- improved server failover
- more reliable failover mechanism
- improved server failover / retry behaviour
- use bulk_args in executemany to increase performance:
- With crate server >= 0.42.0 executemany uses bulk_args and returns a list of results. With crate server < 0.42.0 executemany still issues a request for every parameter and doesn't return any results.
- improved docs formatting of field lists
- fix:
cursor.executemany()
now correctly sets the cursor description
- fix: correctly attach server error trace to crate client exceptions
- fix: only send
error_trace
when it is explicitly set
- expose the
error_trace
option to give a full traceback of server exceptions
- fix: Columns that have an onupdate definition are now correctly updated
- fix: return -1 for rowcount if rowcount attribute is missing in crate response
- fixed redirect handling for blob downloads and uploads.
- implemented ANY operator on object array containment checks for SQLAlchemy
- updated crate to 0.37.1
- bugfix: updates of complex types will only be rewritten if the dialect is set to 'crate' in SQLAlchemy.
- bugfix: raise correct error if fetching infos is not possible because server is not fully started
- bugfix: old versions of six caused import errors
- updated crate doc theme config
- fixed python3.3 compatibility issue in sphinx script
- use new crate doc theme
- replaced requests with urllib3 to improve performance
- add
verify_ssl_cert
andca_cert
as kwargs toConnection
,connect
and as SQLAlchemyconnect_args
- client: fix error handling in
client.server_infos()
- updated crate to 0.32.3
- client: adding keyword arguments
verify_ssl_cert
andca_cert
- to enable ssl server certificate validation
- client: adding keyword arguments
- client: disable ssl server certificate validation by default
- updated crate to 0.31.0
- client: fixed error handling on wrong content-type and bad status codes (on connect)
- removed the crate shell
crash
from this package. it will live now under the namecrate-shell
on pypi.
- updated crate to 0.30.0
- crash: added support for
ALTER
statements. - crash: added support for
REFRESH
statements. - crash: added support for multi-statements for stdin and
--command
parameter - crash: renamed cli parameter
--statement/-s
to--command/-c
- updated crate to 0.29.0. This release contains backward incompatible changes related to blob support.
- updated crash autocompletion keywords
- fix a bug where setting an empty list on a multi valued field results in returning
None
after refreshing the session. - the test layer now uses the '/' crate endpoint in order to wait for crate to be available.
- updated crate to 0.28.0. This release contains backward incompatible changes.
- changed the test layer to no longer use the -f option. Note that this breaks the test layer for all previous crate versions.
- fix readline bug in windows bundle
- readline support for windows
- updated crate to 0.26.0
- added single-file crash bundle
crash.zip.py
- minor documentation syntax fix
- added the ObjectArray type to the sqlalchemy dialect.
- renamed Craty type to Object. Craty can still be imported to maintain backward compatibility
- adapted for compatibility with SQLAlchemy >= 0.9.x
- changed default port to 4200
- allow to specify https urls in client and crash cli
- sqlalchemy dialect supports native booleans
- Fix: Date columns return date objects
- Added
duration
property to the cursor displaying the server-side duration. Show this value at the crash crate cli now instead of client-side duration. - Added readline as a requirement package on OS X (Darwin), fixes umlauts problem.
- Fix sqlalchemy: raise exception if timezone aware datetime is saved
- Fix: raise concrete exception while uploading blobs to an index with disabled blobs support
- crash: check if given servers are available and retrieve some basic information on connect command
- Fix: show rows affected at crash on
copy
command - crash: Added persistent history stored in platform dependent app-dir
- crash: Added support for multiple hosts for
crash --hosts ...
and the connect cmd
- Added SQL
copy
command support to crash crate cli
- crate layer: set working directory on layer instantiation instead of start hook
- fixed sqlalchemy datetime parsing that didn't work with crate >= 0.18.4 due to the fixed datetime mapping.
- documented SQLAlchemy count() and group_by() support.
- http keepalive support
- uppercase command support for crash
- fixed python3.3 compatibility issue in crash
- the crash crate cli supports multiple line commands and auto-completion now, commands are delimited by a semi-colon.
- the crash crate cli displays the status and, if related, the row count on every command now.
- SQLAlchemy DateTime and Date can now be nullable
- fixed an error with the Craty type and SQLAlchemy's ORM where the update statement wasn't correctly generated.
- rowcount in results of update-requests gives affected rows
- the Date and DateTime sqlalchemy types are now supported.
- make http-client thread-safe
- add support for sqlalchemy including complex types
- error handling improvements in crash
- added qmark parameter substitution support
- basic Blob-Client-API implemented
- the crash crate cli is now included with the client library
- the client library is now compatible with python 3
- text files are now also included in binary egg distributions
- initial release