mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Handle different number of columns in dummy driver
Number of cols is inferred from the number of fields in the first row.
This commit is contained in:
parent
5773faaa5c
commit
6b065bd6b6
1 changed files with 2 additions and 1 deletions
|
@ -81,6 +81,7 @@ class DummyDriver < DB::Driver
|
||||||
def initialize(statement, query)
|
def initialize(statement, query)
|
||||||
super(statement)
|
super(statement)
|
||||||
@top_values = query.split.map { |r| r.split(',') }.to_a
|
@top_values = query.split.map { |r| r.split(',') }.to_a
|
||||||
|
@column_count = @top_values.size > 0 ? @top_values[0].size : 2
|
||||||
|
|
||||||
@@last_result_set = self
|
@@last_result_set = self
|
||||||
end
|
end
|
||||||
|
@ -99,7 +100,7 @@ class DummyDriver < DB::Driver
|
||||||
end
|
end
|
||||||
|
|
||||||
def column_count
|
def column_count
|
||||||
2
|
@column_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def column_name(index)
|
def column_name(index)
|
||||||
|
|
Loading…
Reference in a new issue