mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-02-21 10:40:34 +03:00
Update docs for nullable fields
This commit is contained in:
parent
2c0ef08ee1
commit
53e67fb59f
|
@ -1,6 +1,11 @@
|
||||||
Change Log
|
Change Log
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
Unreleased
|
||||||
|
----------
|
||||||
|
- Changed license from PSF to BSD
|
||||||
|
- Nullable fields support (yamiou)
|
||||||
|
|
||||||
v0.9.2
|
v0.9.2
|
||||||
------
|
------
|
||||||
- Added `ne` and `not_in` queryset operators
|
- Added `ne` and `not_in` queryset operators
|
||||||
|
|
|
@ -378,6 +378,13 @@ Extends Field
|
||||||
#### ArrayField(inner_field, default=None, alias=None, materialized=None)
|
#### ArrayField(inner_field, default=None, alias=None, materialized=None)
|
||||||
|
|
||||||
|
|
||||||
|
### NullableField
|
||||||
|
|
||||||
|
Extends Field
|
||||||
|
|
||||||
|
#### NullableField(inner_field, default=None, alias=None, materialized=None, extra_null_values=None)
|
||||||
|
|
||||||
|
|
||||||
### FixedStringField
|
### FixedStringField
|
||||||
|
|
||||||
Extends StringField
|
Extends StringField
|
||||||
|
|
|
@ -105,12 +105,11 @@ Usage:
|
||||||
db.select('SELECT * FROM $db.event', model_class=Event)
|
db.select('SELECT * FROM $db.event', model_class=Event)
|
||||||
|
|
||||||
Working with nullable fields
|
Working with nullable fields
|
||||||
------------------------------------------
|
----------------------------
|
||||||
From [some time](https://github.com/yandex/ClickHouse/pull/70) ClickHouse provides a NULL value support.
|
From [some time](https://github.com/yandex/ClickHouse/pull/70) ClickHouse provides a NULL value support.
|
||||||
Also see some information [here](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00395_nullable.sql).
|
Also see some information [here](https://github.com/yandex/ClickHouse/blob/master/dbms/tests/queries/0_stateless/00395_nullable.sql).
|
||||||
|
|
||||||
You can create fields, that can contain any data type (except Enum)
|
Wrapping another field in a `NullableField` makes it possible to assign `None` to that field. For example:
|
||||||
or 'None' value, for example:
|
|
||||||
|
|
||||||
class EventData(models.Model):
|
class EventData(models.Model):
|
||||||
|
|
||||||
|
@ -127,7 +126,10 @@ or 'None' value, for example:
|
||||||
another_event = EventData(date=date.today(), comment='', score=None, serie=None)
|
another_event = EventData(date=date.today(), comment='', score=None, serie=None)
|
||||||
action_event = EventData(date=date.today(), comment='', score=None, serie=[1, 2, 3])
|
action_event = EventData(date=date.today(), comment='', score=None, serie=[1, 2, 3])
|
||||||
|
|
||||||
NOTE: ArrayField of NullableField yet not supported.
|
The `extra_null_values` parameter is an iterable of additional values that should be converted
|
||||||
|
to `None`.
|
||||||
|
|
||||||
|
NOTE: `ArrayField` of `NullableField` is not supported. Also `EnumField` cannot be nullable.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
* [Working with enum fields](field_types.md#working-with-enum-fields)
|
* [Working with enum fields](field_types.md#working-with-enum-fields)
|
||||||
* [Working with array fields](field_types.md#working-with-array-fields)
|
* [Working with array fields](field_types.md#working-with-array-fields)
|
||||||
* [Working with materialized and alias fields](field_types.md#working-with-materialized-and-alias-fields)
|
* [Working with materialized and alias fields](field_types.md#working-with-materialized-and-alias-fields)
|
||||||
|
* [Working with nullable fields](field_types.md#working-with-nullable-fields)
|
||||||
|
|
||||||
* [Table Engines](table_engines.md#table-engines)
|
* [Table Engines](table_engines.md#table-engines)
|
||||||
* [Simple Engines](table_engines.md#simple-engines)
|
* [Simple Engines](table_engines.md#simple-engines)
|
||||||
|
@ -60,6 +61,7 @@
|
||||||
* [BaseFloatField](class_reference.md#basefloatfield)
|
* [BaseFloatField](class_reference.md#basefloatfield)
|
||||||
* [BaseEnumField](class_reference.md#baseenumfield)
|
* [BaseEnumField](class_reference.md#baseenumfield)
|
||||||
* [ArrayField](class_reference.md#arrayfield)
|
* [ArrayField](class_reference.md#arrayfield)
|
||||||
|
* [NullableField](class_reference.md#nullablefield)
|
||||||
* [FixedStringField](class_reference.md#fixedstringfield)
|
* [FixedStringField](class_reference.md#fixedstringfield)
|
||||||
* [UInt8Field](class_reference.md#uint8field)
|
* [UInt8Field](class_reference.md#uint8field)
|
||||||
* [UInt16Field](class_reference.md#uint16field)
|
* [UInt16Field](class_reference.md#uint16field)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user