sqlspec 0.26.0__py3-none-any.whl → 0.28.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sqlspec might be problematic. Click here for more details.
- sqlspec/__init__.py +7 -15
- sqlspec/_serialization.py +55 -25
- sqlspec/_typing.py +155 -52
- sqlspec/adapters/adbc/_types.py +1 -1
- sqlspec/adapters/adbc/adk/__init__.py +5 -0
- sqlspec/adapters/adbc/adk/store.py +880 -0
- sqlspec/adapters/adbc/config.py +62 -12
- sqlspec/adapters/adbc/data_dictionary.py +74 -2
- sqlspec/adapters/adbc/driver.py +226 -58
- sqlspec/adapters/adbc/litestar/__init__.py +5 -0
- sqlspec/adapters/adbc/litestar/store.py +504 -0
- sqlspec/adapters/adbc/type_converter.py +44 -50
- sqlspec/adapters/aiosqlite/_types.py +1 -1
- sqlspec/adapters/aiosqlite/adk/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/adk/store.py +536 -0
- sqlspec/adapters/aiosqlite/config.py +86 -16
- sqlspec/adapters/aiosqlite/data_dictionary.py +34 -2
- sqlspec/adapters/aiosqlite/driver.py +127 -38
- sqlspec/adapters/aiosqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/litestar/store.py +281 -0
- sqlspec/adapters/aiosqlite/pool.py +7 -7
- sqlspec/adapters/asyncmy/__init__.py +7 -1
- sqlspec/adapters/asyncmy/_types.py +1 -1
- sqlspec/adapters/asyncmy/adk/__init__.py +5 -0
- sqlspec/adapters/asyncmy/adk/store.py +503 -0
- sqlspec/adapters/asyncmy/config.py +59 -17
- sqlspec/adapters/asyncmy/data_dictionary.py +41 -2
- sqlspec/adapters/asyncmy/driver.py +293 -62
- sqlspec/adapters/asyncmy/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncmy/litestar/store.py +296 -0
- sqlspec/adapters/asyncpg/__init__.py +2 -1
- sqlspec/adapters/asyncpg/_type_handlers.py +71 -0
- sqlspec/adapters/asyncpg/_types.py +11 -7
- sqlspec/adapters/asyncpg/adk/__init__.py +5 -0
- sqlspec/adapters/asyncpg/adk/store.py +460 -0
- sqlspec/adapters/asyncpg/config.py +57 -36
- sqlspec/adapters/asyncpg/data_dictionary.py +48 -2
- sqlspec/adapters/asyncpg/driver.py +153 -23
- sqlspec/adapters/asyncpg/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncpg/litestar/store.py +253 -0
- sqlspec/adapters/bigquery/_types.py +1 -1
- sqlspec/adapters/bigquery/adk/__init__.py +5 -0
- sqlspec/adapters/bigquery/adk/store.py +585 -0
- sqlspec/adapters/bigquery/config.py +36 -11
- sqlspec/adapters/bigquery/data_dictionary.py +42 -2
- sqlspec/adapters/bigquery/driver.py +489 -144
- sqlspec/adapters/bigquery/litestar/__init__.py +5 -0
- sqlspec/adapters/bigquery/litestar/store.py +327 -0
- sqlspec/adapters/bigquery/type_converter.py +55 -23
- sqlspec/adapters/duckdb/_types.py +2 -2
- sqlspec/adapters/duckdb/adk/__init__.py +14 -0
- sqlspec/adapters/duckdb/adk/store.py +563 -0
- sqlspec/adapters/duckdb/config.py +79 -21
- sqlspec/adapters/duckdb/data_dictionary.py +41 -2
- sqlspec/adapters/duckdb/driver.py +225 -44
- sqlspec/adapters/duckdb/litestar/__init__.py +5 -0
- sqlspec/adapters/duckdb/litestar/store.py +332 -0
- sqlspec/adapters/duckdb/pool.py +5 -5
- sqlspec/adapters/duckdb/type_converter.py +51 -21
- sqlspec/adapters/oracledb/_numpy_handlers.py +133 -0
- sqlspec/adapters/oracledb/_types.py +20 -2
- sqlspec/adapters/oracledb/adk/__init__.py +5 -0
- sqlspec/adapters/oracledb/adk/store.py +1628 -0
- sqlspec/adapters/oracledb/config.py +120 -36
- sqlspec/adapters/oracledb/data_dictionary.py +87 -20
- sqlspec/adapters/oracledb/driver.py +475 -86
- sqlspec/adapters/oracledb/litestar/__init__.py +5 -0
- sqlspec/adapters/oracledb/litestar/store.py +765 -0
- sqlspec/adapters/oracledb/migrations.py +316 -25
- sqlspec/adapters/oracledb/type_converter.py +91 -16
- sqlspec/adapters/psqlpy/_type_handlers.py +44 -0
- sqlspec/adapters/psqlpy/_types.py +2 -1
- sqlspec/adapters/psqlpy/adk/__init__.py +5 -0
- sqlspec/adapters/psqlpy/adk/store.py +483 -0
- sqlspec/adapters/psqlpy/config.py +45 -19
- sqlspec/adapters/psqlpy/data_dictionary.py +48 -2
- sqlspec/adapters/psqlpy/driver.py +108 -41
- sqlspec/adapters/psqlpy/litestar/__init__.py +5 -0
- sqlspec/adapters/psqlpy/litestar/store.py +272 -0
- sqlspec/adapters/psqlpy/type_converter.py +40 -11
- sqlspec/adapters/psycopg/_type_handlers.py +80 -0
- sqlspec/adapters/psycopg/_types.py +2 -1
- sqlspec/adapters/psycopg/adk/__init__.py +5 -0
- sqlspec/adapters/psycopg/adk/store.py +962 -0
- sqlspec/adapters/psycopg/config.py +65 -37
- sqlspec/adapters/psycopg/data_dictionary.py +91 -3
- sqlspec/adapters/psycopg/driver.py +200 -78
- sqlspec/adapters/psycopg/litestar/__init__.py +5 -0
- sqlspec/adapters/psycopg/litestar/store.py +554 -0
- sqlspec/adapters/sqlite/__init__.py +2 -1
- sqlspec/adapters/sqlite/_type_handlers.py +86 -0
- sqlspec/adapters/sqlite/_types.py +1 -1
- sqlspec/adapters/sqlite/adk/__init__.py +5 -0
- sqlspec/adapters/sqlite/adk/store.py +582 -0
- sqlspec/adapters/sqlite/config.py +85 -16
- sqlspec/adapters/sqlite/data_dictionary.py +34 -2
- sqlspec/adapters/sqlite/driver.py +120 -52
- sqlspec/adapters/sqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/sqlite/litestar/store.py +318 -0
- sqlspec/adapters/sqlite/pool.py +5 -5
- sqlspec/base.py +45 -26
- sqlspec/builder/__init__.py +73 -4
- sqlspec/builder/_base.py +91 -58
- sqlspec/builder/_column.py +5 -5
- sqlspec/builder/_ddl.py +98 -89
- sqlspec/builder/_delete.py +5 -4
- sqlspec/builder/_dml.py +388 -0
- sqlspec/{_sql.py → builder/_factory.py} +41 -44
- sqlspec/builder/_insert.py +5 -82
- sqlspec/builder/{mixins/_join_operations.py → _join.py} +145 -143
- sqlspec/builder/_merge.py +446 -11
- sqlspec/builder/_parsing_utils.py +9 -11
- sqlspec/builder/_select.py +1313 -25
- sqlspec/builder/_update.py +11 -42
- sqlspec/cli.py +76 -69
- sqlspec/config.py +331 -62
- sqlspec/core/__init__.py +5 -4
- sqlspec/core/cache.py +18 -18
- sqlspec/core/compiler.py +6 -8
- sqlspec/core/filters.py +55 -47
- sqlspec/core/hashing.py +9 -9
- sqlspec/core/parameters.py +76 -45
- sqlspec/core/result.py +234 -47
- sqlspec/core/splitter.py +16 -17
- sqlspec/core/statement.py +32 -31
- sqlspec/core/type_conversion.py +3 -2
- sqlspec/driver/__init__.py +1 -3
- sqlspec/driver/_async.py +183 -160
- sqlspec/driver/_common.py +197 -109
- sqlspec/driver/_sync.py +189 -161
- sqlspec/driver/mixins/_result_tools.py +20 -236
- sqlspec/driver/mixins/_sql_translator.py +4 -4
- sqlspec/exceptions.py +70 -7
- sqlspec/extensions/adk/__init__.py +53 -0
- sqlspec/extensions/adk/_types.py +51 -0
- sqlspec/extensions/adk/converters.py +172 -0
- sqlspec/extensions/adk/migrations/0001_create_adk_tables.py +144 -0
- sqlspec/extensions/adk/migrations/__init__.py +0 -0
- sqlspec/extensions/adk/service.py +181 -0
- sqlspec/extensions/adk/store.py +536 -0
- sqlspec/extensions/aiosql/adapter.py +69 -61
- sqlspec/extensions/fastapi/__init__.py +21 -0
- sqlspec/extensions/fastapi/extension.py +331 -0
- sqlspec/extensions/fastapi/providers.py +543 -0
- sqlspec/extensions/flask/__init__.py +36 -0
- sqlspec/extensions/flask/_state.py +71 -0
- sqlspec/extensions/flask/_utils.py +40 -0
- sqlspec/extensions/flask/extension.py +389 -0
- sqlspec/extensions/litestar/__init__.py +21 -4
- sqlspec/extensions/litestar/cli.py +54 -10
- sqlspec/extensions/litestar/config.py +56 -266
- sqlspec/extensions/litestar/handlers.py +46 -17
- sqlspec/extensions/litestar/migrations/0001_create_session_table.py +137 -0
- sqlspec/extensions/litestar/migrations/__init__.py +3 -0
- sqlspec/extensions/litestar/plugin.py +349 -224
- sqlspec/extensions/litestar/providers.py +25 -25
- sqlspec/extensions/litestar/store.py +265 -0
- sqlspec/extensions/starlette/__init__.py +10 -0
- sqlspec/extensions/starlette/_state.py +25 -0
- sqlspec/extensions/starlette/_utils.py +52 -0
- sqlspec/extensions/starlette/extension.py +254 -0
- sqlspec/extensions/starlette/middleware.py +154 -0
- sqlspec/loader.py +30 -49
- sqlspec/migrations/base.py +200 -76
- sqlspec/migrations/commands.py +591 -62
- sqlspec/migrations/context.py +6 -9
- sqlspec/migrations/fix.py +199 -0
- sqlspec/migrations/loaders.py +47 -19
- sqlspec/migrations/runner.py +241 -75
- sqlspec/migrations/tracker.py +237 -21
- sqlspec/migrations/utils.py +51 -3
- sqlspec/migrations/validation.py +177 -0
- sqlspec/protocols.py +106 -36
- sqlspec/storage/_utils.py +85 -0
- sqlspec/storage/backends/fsspec.py +133 -107
- sqlspec/storage/backends/local.py +78 -51
- sqlspec/storage/backends/obstore.py +276 -168
- sqlspec/storage/registry.py +75 -39
- sqlspec/typing.py +30 -84
- sqlspec/utils/__init__.py +25 -4
- sqlspec/utils/arrow_helpers.py +81 -0
- sqlspec/utils/config_resolver.py +6 -6
- sqlspec/utils/correlation.py +4 -5
- sqlspec/utils/data_transformation.py +3 -2
- sqlspec/utils/deprecation.py +9 -8
- sqlspec/utils/fixtures.py +4 -4
- sqlspec/utils/logging.py +46 -6
- sqlspec/utils/module_loader.py +205 -5
- sqlspec/utils/portal.py +311 -0
- sqlspec/utils/schema.py +288 -0
- sqlspec/utils/serializers.py +113 -4
- sqlspec/utils/sync_tools.py +36 -22
- sqlspec/utils/text.py +1 -2
- sqlspec/utils/type_guards.py +136 -20
- sqlspec/utils/version.py +433 -0
- {sqlspec-0.26.0.dist-info → sqlspec-0.28.0.dist-info}/METADATA +41 -22
- sqlspec-0.28.0.dist-info/RECORD +221 -0
- sqlspec/builder/mixins/__init__.py +0 -55
- sqlspec/builder/mixins/_cte_and_set_ops.py +0 -253
- sqlspec/builder/mixins/_delete_operations.py +0 -50
- sqlspec/builder/mixins/_insert_operations.py +0 -282
- sqlspec/builder/mixins/_merge_operations.py +0 -698
- sqlspec/builder/mixins/_order_limit_operations.py +0 -145
- sqlspec/builder/mixins/_pivot_operations.py +0 -157
- sqlspec/builder/mixins/_select_operations.py +0 -930
- sqlspec/builder/mixins/_update_operations.py +0 -199
- sqlspec/builder/mixins/_where_clause.py +0 -1298
- sqlspec-0.26.0.dist-info/RECORD +0 -157
- sqlspec-0.26.0.dist-info/licenses/NOTICE +0 -29
- {sqlspec-0.26.0.dist-info → sqlspec-0.28.0.dist-info}/WHEEL +0 -0
- {sqlspec-0.26.0.dist-info → sqlspec-0.28.0.dist-info}/entry_points.txt +0 -0
- {sqlspec-0.26.0.dist-info → sqlspec-0.28.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import contextlib
|
|
4
4
|
import logging
|
|
5
|
-
from typing import TYPE_CHECKING, Any,
|
|
5
|
+
from typing import TYPE_CHECKING, Any, ClassVar, TypedDict
|
|
6
6
|
|
|
7
7
|
from google.cloud.bigquery import LoadJobConfig, QueryJobConfig
|
|
8
8
|
from typing_extensions import NotRequired
|
|
@@ -14,7 +14,7 @@ from sqlspec.exceptions import ImproperConfigurationError
|
|
|
14
14
|
from sqlspec.typing import Empty
|
|
15
15
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
|
-
from collections.abc import Generator
|
|
17
|
+
from collections.abc import Callable, Generator
|
|
18
18
|
|
|
19
19
|
from google.api_core.client_info import ClientInfo
|
|
20
20
|
from google.api_core.client_options import ClientOptions
|
|
@@ -26,7 +26,7 @@ if TYPE_CHECKING:
|
|
|
26
26
|
logger = logging.getLogger(__name__)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
class BigQueryConnectionParams(TypedDict
|
|
29
|
+
class BigQueryConnectionParams(TypedDict):
|
|
30
30
|
"""Standard BigQuery connection parameters.
|
|
31
31
|
|
|
32
32
|
Includes both official BigQuery client parameters and BigQuery-specific configuration options.
|
|
@@ -63,16 +63,29 @@ class BigQueryConnectionParams(TypedDict, total=False):
|
|
|
63
63
|
extra: NotRequired[dict[str, Any]]
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
class BigQueryDriverFeatures(TypedDict
|
|
66
|
+
class BigQueryDriverFeatures(TypedDict):
|
|
67
67
|
"""BigQuery driver-specific features configuration.
|
|
68
68
|
|
|
69
69
|
Only non-standard BigQuery client parameters that are SQLSpec-specific extensions.
|
|
70
|
+
|
|
71
|
+
Attributes:
|
|
72
|
+
connection_instance: Pre-existing BigQuery connection instance to use.
|
|
73
|
+
on_job_start: Callback invoked when a query job starts.
|
|
74
|
+
on_job_complete: Callback invoked when a query job completes.
|
|
75
|
+
on_connection_create: Callback invoked when connection is created.
|
|
76
|
+
json_serializer: Custom JSON serializer for dict/list parameter conversion.
|
|
77
|
+
Defaults to sqlspec.utils.serializers.to_json if not provided.
|
|
78
|
+
enable_uuid_conversion: Enable automatic UUID string conversion.
|
|
79
|
+
When True (default), UUID strings are automatically converted to UUID objects.
|
|
80
|
+
When False, UUID strings are treated as regular strings.
|
|
70
81
|
"""
|
|
71
82
|
|
|
72
83
|
connection_instance: NotRequired["BigQueryConnection"]
|
|
73
84
|
on_job_start: NotRequired["Callable[[str], None]"]
|
|
74
85
|
on_job_complete: NotRequired["Callable[[str, Any], None]"]
|
|
75
86
|
on_connection_create: NotRequired["Callable[[Any], None]"]
|
|
87
|
+
json_serializer: NotRequired["Callable[[Any], str]"]
|
|
88
|
+
enable_uuid_conversion: NotRequired[bool]
|
|
76
89
|
|
|
77
90
|
|
|
78
91
|
__all__ = ("BigQueryConfig", "BigQueryConnectionParams", "BigQueryDriverFeatures")
|
|
@@ -86,15 +99,17 @@ class BigQueryConfig(NoPoolSyncConfig[BigQueryConnection, BigQueryDriver]):
|
|
|
86
99
|
|
|
87
100
|
driver_type: ClassVar[type[BigQueryDriver]] = BigQueryDriver
|
|
88
101
|
connection_type: "ClassVar[type[BigQueryConnection]]" = BigQueryConnection
|
|
102
|
+
supports_transactional_ddl: ClassVar[bool] = False
|
|
89
103
|
|
|
90
104
|
def __init__(
|
|
91
105
|
self,
|
|
92
106
|
*,
|
|
93
|
-
connection_config: "
|
|
94
|
-
migration_config:
|
|
95
|
-
statement_config: "
|
|
96
|
-
driver_features: "
|
|
97
|
-
bind_key: "
|
|
107
|
+
connection_config: "BigQueryConnectionParams | dict[str, Any] | None" = None,
|
|
108
|
+
migration_config: dict[str, Any] | None = None,
|
|
109
|
+
statement_config: "StatementConfig | None" = None,
|
|
110
|
+
driver_features: "BigQueryDriverFeatures | dict[str, Any] | None" = None,
|
|
111
|
+
bind_key: "str | None" = None,
|
|
112
|
+
extension_config: "dict[str, dict[str, Any]] | None" = None,
|
|
98
113
|
) -> None:
|
|
99
114
|
"""Initialize BigQuery configuration.
|
|
100
115
|
|
|
@@ -104,6 +119,7 @@ class BigQueryConfig(NoPoolSyncConfig[BigQueryConnection, BigQueryDriver]):
|
|
|
104
119
|
statement_config: Statement configuration override
|
|
105
120
|
driver_features: BigQuery-specific driver features
|
|
106
121
|
bind_key: Optional unique identifier for this configuration
|
|
122
|
+
extension_config: Extension-specific configuration (e.g., Litestar plugin settings)
|
|
107
123
|
"""
|
|
108
124
|
|
|
109
125
|
self.connection_config: dict[str, Any] = dict(connection_config) if connection_config else {}
|
|
@@ -113,7 +129,15 @@ class BigQueryConfig(NoPoolSyncConfig[BigQueryConnection, BigQueryDriver]):
|
|
|
113
129
|
|
|
114
130
|
self.driver_features: dict[str, Any] = dict(driver_features) if driver_features else {}
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
if "enable_uuid_conversion" not in self.driver_features:
|
|
133
|
+
self.driver_features["enable_uuid_conversion"] = True
|
|
134
|
+
|
|
135
|
+
if "json_serializer" not in self.driver_features:
|
|
136
|
+
from sqlspec.utils.serializers import to_json
|
|
137
|
+
|
|
138
|
+
self.driver_features["json_serializer"] = to_json
|
|
139
|
+
|
|
140
|
+
self._connection_instance: BigQueryConnection | None = self.driver_features.get("connection_instance")
|
|
117
141
|
|
|
118
142
|
if "default_query_job_config" not in self.connection_config:
|
|
119
143
|
self._setup_default_job_config()
|
|
@@ -127,6 +151,7 @@ class BigQueryConfig(NoPoolSyncConfig[BigQueryConnection, BigQueryDriver]):
|
|
|
127
151
|
statement_config=statement_config,
|
|
128
152
|
driver_features=self.driver_features,
|
|
129
153
|
bind_key=bind_key,
|
|
154
|
+
extension_config=extension_config,
|
|
130
155
|
)
|
|
131
156
|
|
|
132
157
|
def _setup_default_job_config(self) -> None:
|
|
@@ -215,7 +240,7 @@ class BigQueryConfig(NoPoolSyncConfig[BigQueryConnection, BigQueryDriver]):
|
|
|
215
240
|
|
|
216
241
|
@contextlib.contextmanager
|
|
217
242
|
def provide_session(
|
|
218
|
-
self, *_args: Any, statement_config: "
|
|
243
|
+
self, *_args: Any, statement_config: "StatementConfig | None" = None, **_kwargs: Any
|
|
219
244
|
) -> "Generator[BigQueryDriver, None, None]":
|
|
220
245
|
"""Provide a BigQuery driver session context manager.
|
|
221
246
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"""BigQuery-specific data dictionary for metadata queries."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
4
4
|
|
|
5
5
|
from sqlspec.driver import SyncDataDictionaryBase, SyncDriverAdapterBase, VersionInfo
|
|
6
6
|
from sqlspec.utils.logging import get_logger
|
|
7
7
|
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from sqlspec.adapters.bigquery.driver import BigQueryDriver
|
|
10
|
+
|
|
8
11
|
logger = get_logger("adapters.bigquery.data_dictionary")
|
|
9
12
|
|
|
10
13
|
__all__ = ("BigQuerySyncDataDictionary",)
|
|
@@ -13,7 +16,7 @@ __all__ = ("BigQuerySyncDataDictionary",)
|
|
|
13
16
|
class BigQuerySyncDataDictionary(SyncDataDictionaryBase):
|
|
14
17
|
"""BigQuery-specific sync data dictionary."""
|
|
15
18
|
|
|
16
|
-
def get_version(self, driver: SyncDriverAdapterBase) -> "
|
|
19
|
+
def get_version(self, driver: SyncDriverAdapterBase) -> "VersionInfo | None":
|
|
17
20
|
"""Get BigQuery version information.
|
|
18
21
|
|
|
19
22
|
BigQuery is a cloud service without traditional versioning.
|
|
@@ -85,6 +88,43 @@ class BigQuerySyncDataDictionary(SyncDataDictionaryBase):
|
|
|
85
88
|
}
|
|
86
89
|
return type_map.get(type_category, "STRING")
|
|
87
90
|
|
|
91
|
+
def get_columns(
|
|
92
|
+
self, driver: SyncDriverAdapterBase, table: str, schema: "str | None" = None
|
|
93
|
+
) -> "list[dict[str, Any]]":
|
|
94
|
+
"""Get column information for a table using INFORMATION_SCHEMA.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
driver: BigQuery driver instance
|
|
98
|
+
table: Table name to query columns for
|
|
99
|
+
schema: Schema name (dataset name in BigQuery)
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
List of column metadata dictionaries with keys:
|
|
103
|
+
- column_name: Name of the column
|
|
104
|
+
- data_type: BigQuery data type
|
|
105
|
+
- is_nullable: Whether column allows NULL (YES/NO)
|
|
106
|
+
- column_default: Default value if any
|
|
107
|
+
"""
|
|
108
|
+
bigquery_driver = cast("BigQueryDriver", driver)
|
|
109
|
+
|
|
110
|
+
if schema:
|
|
111
|
+
sql = f"""
|
|
112
|
+
SELECT column_name, data_type, is_nullable, column_default
|
|
113
|
+
FROM `{schema}.INFORMATION_SCHEMA.COLUMNS`
|
|
114
|
+
WHERE table_name = '{table}'
|
|
115
|
+
ORDER BY ordinal_position
|
|
116
|
+
"""
|
|
117
|
+
else:
|
|
118
|
+
sql = f"""
|
|
119
|
+
SELECT column_name, data_type, is_nullable, column_default
|
|
120
|
+
FROM INFORMATION_SCHEMA.COLUMNS
|
|
121
|
+
WHERE table_name = '{table}'
|
|
122
|
+
ORDER BY ordinal_position
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
result = bigquery_driver.execute(sql)
|
|
126
|
+
return result.data or []
|
|
127
|
+
|
|
88
128
|
def list_available_features(self) -> "list[str]":
|
|
89
129
|
"""List available BigQuery feature flags.
|
|
90
130
|
|