mirror of
https://github.com/hanzo-ds/connect.git
synced 2026-10-30 20:31:24 +00:00
The wire protocol was the last holdout and it was not cosmetic: the Hanzo Datastore server reads X-Datastore-User, and answers a request bearing X-ClickHouse-User with 401. Verified against the live server, both directions. So a client still sending the old headers is not merely off-brand, it cannot authenticate over HTTP. Everything else follows: types, dialects, error modules, docstrings and doc links now name Datastore, and doc URLs point at docs.hanzo.ai/datastore rather than the upstream vendor's site. Zero occurrences of the old name remain. Still cut from the pinned upstream version, so behaviour is unchanged.
42 lines
826 B
Python
42 lines
826 B
Python
from typing import NamedTuple
|
|
|
|
from datastore_connect.datatypes.registry import get_from_name
|
|
|
|
|
|
class ColumnDef(NamedTuple):
|
|
"""
|
|
Datastore column definition from DESCRIBE TABLE command
|
|
"""
|
|
name: str
|
|
type: str
|
|
default_type: str
|
|
default_expression: str
|
|
comment: str
|
|
codec_expression: str
|
|
ttl_expression: str
|
|
|
|
@property
|
|
def type_name(self):
|
|
return self.type.replace('\n', '').strip()
|
|
|
|
@property
|
|
def ch_type(self):
|
|
return get_from_name(self.type_name)
|
|
|
|
|
|
class SettingDef(NamedTuple):
|
|
"""
|
|
Datastore setting definition from system.settings table
|
|
"""
|
|
name: str
|
|
value: str
|
|
readonly: int
|
|
|
|
|
|
class SettingStatus(NamedTuple):
|
|
"""
|
|
Get the setting "status" from a Datastore server setting
|
|
"""
|
|
is_set: bool
|
|
is_writable: bool
|