mirror of
				https://github.com/Infinidat/infi.clickhouse_orm.git
				synced 2025-10-31 15:57:32 +03:00 
			
		
		
		
	Update docs for nullable fields
This commit is contained in:
		
							parent
							
								
									2c0ef08ee1
								
							
						
					
					
						commit
						53e67fb59f
					
				|  | @ -1,6 +1,11 @@ | |||
| Change Log | ||||
| ========== | ||||
| 
 | ||||
| Unreleased | ||||
| ---------- | ||||
| - Changed license from PSF to BSD | ||||
| - Nullable fields support (yamiou) | ||||
| 
 | ||||
| v0.9.2 | ||||
| ------ | ||||
| - Added `ne` and `not_in` queryset operators | ||||
|  |  | |||
|  | @ -378,6 +378,13 @@ Extends Field | |||
| #### 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 | ||||
| 
 | ||||
| Extends StringField | ||||
|  |  | |||
|  | @ -105,12 +105,11 @@ Usage: | |||
|     db.select('SELECT * FROM $db.event', model_class=Event) | ||||
| 
 | ||||
| Working with nullable fields | ||||
| ------------------------------------------ | ||||
| ---------------------------- | ||||
| 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). | ||||
| 
 | ||||
| You can create fields, that can contain any data type (except Enum)  | ||||
| or 'None' value, for example: | ||||
| Wrapping another field in a `NullableField` makes it possible to assign `None` to that field. For example: | ||||
| 
 | ||||
|     class EventData(models.Model): | ||||
| 
 | ||||
|  | @ -127,7 +126,10 @@ or 'None' value, for example: | |||
|     another_event = EventData(date=date.today(), comment='', score=None, serie=None) | ||||
|     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 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 nullable fields](field_types.md#working-with-nullable-fields) | ||||
| 
 | ||||
|    * [Table Engines](table_engines.md#table-engines) | ||||
|       * [Simple Engines](table_engines.md#simple-engines) | ||||
|  | @ -60,6 +61,7 @@ | |||
|          * [BaseFloatField](class_reference.md#basefloatfield) | ||||
|          * [BaseEnumField](class_reference.md#baseenumfield) | ||||
|          * [ArrayField](class_reference.md#arrayfield) | ||||
|          * [NullableField](class_reference.md#nullablefield) | ||||
|          * [FixedStringField](class_reference.md#fixedstringfield) | ||||
|          * [UInt8Field](class_reference.md#uint8field) | ||||
|          * [UInt16Field](class_reference.md#uint16field) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user