Repository navigation
Releases
Releases · davyddd/ddaerospike
v0.0.4
v0.0.3
🔄 Changed
- Requires
ddutils >= 0.4.0, < 0.5.0. The README wires the client registry withprocess_loop_scopefrom ddutils 0.4.0 instead of a scope function of its own, since the client completes its futures on the loop it was created in.
📝 Docs
- Records: simple and composite bins,
RootModelfor typed lists and maps, a bin set toNoneis removed by the write and a record with no bins left is deleted by the server,filter_binsto leave a bin untouched, an empty map or list is a value so an optional composite needs a default,factory/to_entity/from_entity. The bare-datetimecheck covers the model's own fields only: a nestedBaseModelwith a baredatetimestores an ISO string that no filter matches, soAerospikeTimestampgoes inside composite models too.AerospikeDataWithPK.pkisNonefor a record written withoutsend_key. - Manager: the checks at class definition, a table of the methods with their return values (
get_mapleaves out a key the batch could not answer,find_onepicks an arbitrary match,putmerges the model's bins andif_absentis create-only), whatlimitmeans:max_recordsis split across the nodes and treated as an upper bound, so a query may return fewer thanlimitrecords although more match, in no order and without a cursor. A*_policy_fieldsoverride replaces the whole dict, so extendDEFAULT_WRITE_POLICYand the others, orsend_key=Trueis gone and queries stop returningpk; the defaults are tabulated. TTL semantics,Expiration.DONT_UPDATEwithout a TTL and the refusal of a namespace withnsup-period 0. - Filters: why the collection is bound to the record model (the server compares typed values, a value of another type matches nothing, silently), the scalar of every bin annotation, the operator table,
IS_NULLas "the bin is missing" andNOT_EQUALbeing false on a missing bin, one index filter per query and the pairs an index answers, the public building blocks. - Feature flag storage:
getreads a malformed record as the defaults whileget_mapraisesFeatureFlagStorageErroron one,LIST_LIMITof 1000 with an ERROR log,pkrequiressend_key=True,renameis put-then-delete. AerospikeDsnrequires the namespace andseedsis a string, unlikeKafkaDsn.bootstrap_servers; the server versions the library was exercised on, the error hierarchy, the uvloop policy installed on import andAEROSPIKE_NO_UVLOOP. The layout follows dd-lib-stub, with a Compatibility section.
Full Changelog: v0.0.2...v0.0.3
v0.0.2
🔄 Changed
AerospikeManager.get_list/find_onepasslimitto the server asQueryPolicy.max_records: the nodes stop once that many records are out instead of streaming the whole set to a client that reads one. The exactlimitis still applied on the client, so the result is the same with far less work on the cluster.client_factoryis typedConnectionManagerFactory[Any, Client, Any]: a project's factory with its own connection manager type passes the type checker.get_mapkeeps returning only what the batch read: a key the batch could not answer (a timeout, a node away) is left out like a missing one; this is now documented.
Full Changelog: v0.0.1...v0.0.2
v0.0.1
🚀 Added
dsn.AerospikeDsn: a settings field for a cluster,aerospike://host[:port][,host[:port]]/<namespace>, validated as a URL like pydantic'sPostgresDsn;seedsis whatnew_clienttakes,namespaceis required.data.AerospikeData[Entity]: a record of a set, every field a bin. Scalars and plain containers are simple bins, aBaseModel/RootModelfield is a composite bin stored as a map or list. Datetimes are declared asAerospikeTimestamp(integer microseconds, UTC); a baredatetimefield or a bin name over 15 characters is rejected at class definition. Subclasses map to and from the domain throughto_entity/from_entity.filters.AerospikeFilterCollection(Model): the conditions of one query, bound to the record model: at most one secondary-index filter (equality onint/str, a range onint) and any number of filter expressions, ANDed.add_filterchecks the bin and matches the value against the bin's scalar; values are normalized the way the server compares them (enums, UUIDs, datetimes,Decimal). Composite bins takeis_null/is_not_nullonly.manager.AerospikeManager[Data]: ORM-like access to one set:get,get_map,get_list,find_one,put(optionally create-only),delete, with a TTL set by every write and typed policy overrides. The client is obtained for every call fromclient_factory, aConnectionManagerFactoryfrom ddutils called withalias, which owns the client's scope and its close on shutdown.feature_flags.AerospikeFeatureFlagStorage: the Aerospike backend of ddutils feature flags, one set, a flag per record, through anAerospikeManager[FeatureFlagData].
Supports Python 3.11–3.14 on aerospike-native 1.x.
Full Changelog: https://github.com/davyddd/ddaerospike/commits/v0.0.1