20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/llm_cost_tracker/ledger/schema/ingestion_leases.rb', line 20
def current_schema_errors
connection = LlmCostTracker::Ingestion::Lease.connection
Adapter.ensure_supported!(connection)
table_name = LlmCostTracker::Ingestion::Lease.table_name
return ["#{table_name} table is missing"] unless connection.data_source_exists?(table_name)
columns = LlmCostTracker::Ingestion::Lease.columns_hash
cache = @schema_capabilities
return cache.fetch(:errors) if cache && cache.fetch(:columns).equal?(columns)
errors = compute_errors(connection, table_name, columns)
@schema_capabilities = { columns: columns, errors: errors }
errors
end
|