fixed generator in snowflake_column() in sqlalchemy module
This commit is contained in:
parent
1d6d5d72f8
commit
121fbe83b0
2 changed files with 6 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.3.1
|
||||||
|
|
||||||
|
- Fixed bugs in Snowflake generation and serialization of negative values
|
||||||
|
|
||||||
## 0.3.0
|
## 0.3.0
|
||||||
|
|
||||||
- Fixed `cb32encode()` and `b32lencode()` doing wrong padding — **UNSOLVED in 0.2.x** which is out of support, effective immediately
|
- Fixed `cb32encode()` and `b32lencode()` doing wrong padding — **UNSOLVED in 0.2.x** which is out of support, effective immediately
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ def snowflake_column(*, primary_key: bool = True, **kwargs):
|
||||||
epoch = owner.metadata.info['snowflake_epoch']
|
epoch = owner.metadata.info['snowflake_epoch']
|
||||||
# more arguments will be passed on (?)
|
# more arguments will be passed on (?)
|
||||||
idgen = SnowflakeGen(epoch)
|
idgen = SnowflakeGen(epoch)
|
||||||
def new_id() -> bytes:
|
def new_id() -> int:
|
||||||
return idgen.generate()
|
return idgen.generate_one()
|
||||||
return new_id
|
return new_id
|
||||||
if primary_key:
|
if primary_key:
|
||||||
return Incomplete(Column, BigInteger, primary_key = True, default = Wanted(new_id_factory), **kwargs)
|
return Incomplete(Column, BigInteger, primary_key = True, default = Wanted(new_id_factory), **kwargs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue