Class: LlmCostTracker::Storage::ActiveRecordRollupUpsertSql
- Inherits:
-
Object
- Object
- LlmCostTracker::Storage::ActiveRecordRollupUpsertSql
- Defined in:
- lib/llm_cost_tracker/storage/active_record_rollup_upsert_sql.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(model) ⇒ ActiveRecordRollupUpsertSql
constructor
A new instance of ActiveRecordRollupUpsertSql.
Constructor Details
#initialize(model) ⇒ ActiveRecordRollupUpsertSql
Returns a new instance of ActiveRecordRollupUpsertSql.
12 13 14 |
# File 'lib/llm_cost_tracker/storage/active_record_rollup_upsert_sql.rb', line 12 def initialize(model) @model = model end |
Class Method Details
.call(model) ⇒ Object
8 9 10 |
# File 'lib/llm_cost_tracker/storage/active_record_rollup_upsert_sql.rb', line 8 def self.call(model) new(model).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 |
# File 'lib/llm_cost_tracker/storage/active_record_rollup_upsert_sql.rb', line 16 def call return Arel.sql(mysql_sql) if ActiveRecordAdapter.mysql?(connection) return Arel.sql(postgres_sql) if ActiveRecordAdapter.postgresql?(connection) ActiveRecordAdapter.ensure_supported!(connection) end |