Skip to content

Commit 23245cf

Browse files
Vignesh Narayanaswamyclaude
authored andcommitted
v0.7.1: add read_only flag to SnowflakeLedgerBackend
When read_only=True, skips CREATE SCHEMA/TABLE in __init__. Useful for service accounts with SELECT-only access to an existing inventory. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 929f3a2 commit 23245cf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "model-ledger"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "Developer-first model inventory and governance framework for SR 11-7, EU AI Act, and NIST AI RMF compliance"
55
readme = "README.md"
66
requires-python = ">=3.10"

src/model_ledger/backends/snowflake.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,18 @@ class SnowflakeLedgerBackend:
100100

101101
def __init__(
102102
self, connection: Any, schema: str = "MODEL_LEDGER",
103+
read_only: bool = False,
103104
) -> None:
104105
self._session = connection
105106
self._schema = schema
107+
self._read_only = read_only
106108
parts = schema.split(".")
107109
self._database = parts[0] if len(parts) > 1 else None
108110
self._schema_name = parts[1] if len(parts) > 1 else parts[0]
109111
self._model_buffer: list[ModelRef] = []
110112
self._snapshot_buffer: list[Snapshot] = []
111-
self._ensure_tables()
113+
if not read_only:
114+
self._ensure_tables()
112115

113116
def __enter__(self):
114117
return self

0 commit comments

Comments
 (0)