Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
activerecord-monetdb-adapter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
activerecord-monetdb-adapter
Commits
23c361ed
Commit
23c361ed
authored
9 years ago
by
João Victor Risso
Browse files
Options
Downloads
Patches
Plain Diff
Fix select_rows and exec_query functions; add logging for debug
Signed-off-by:
João Victor Risso
<
jvtr12@inf.ufpr.br
>
parent
b0e87f0d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/active_record/connection_adapters/monetdb/database_statements.rb
+5
-5
5 additions, 5 deletions
...record/connection_adapters/monetdb/database_statements.rb
with
5 additions
and
5 deletions
lib/active_record/connection_adapters/monetdb/database_statements.rb
+
5
−
5
View file @
23c361ed
...
@@ -20,15 +20,15 @@ module ActiveRecord
...
@@ -20,15 +20,15 @@ module ActiveRecord
# Returns an array of arrays containing the field values.
# Returns an array of arrays containing the field values.
# Order is the same as that returned by +columns+.
# Order is the same as that returned by +columns+.
def
select_rows
(
sql
,
name
=
nil
,
binds
=
[])
def
select_rows
(
sql
,
name
=
nil
,
binds
=
[])
ret
=
nil
result
=
execute
(
sql
,
name
)
execute
(
sql
,
name
)
do
|
result
|
ret
=
result
.
fetch_all
ret
=
result
.
fetch_all
end
@logger
.
info
"
#{
__method__
}
ret =
#{
ret
}
"
ret
ret
end
end
# Executes the SQL statement in the context of this connection.
# Executes the SQL statement in the context of this connection.
def
execute
(
sql
,
name
=
nil
)
def
execute
(
sql
,
name
=
nil
)
@logger
.
info
"
#{
__method__
}
sql =
\"
#{
sql
}
\"
"
log
(
sql
,
name
)
do
log
(
sql
,
name
)
do
@connection
.
query
(
sql
)
@connection
.
query
(
sql
)
end
end
...
@@ -39,7 +39,7 @@ module ActiveRecord
...
@@ -39,7 +39,7 @@ module ActiveRecord
# the executed +sql+ statement.
# the executed +sql+ statement.
def
exec_query
(
sql
,
name
=
'SQL'
,
binds
=
[])
def
exec_query
(
sql
,
name
=
'SQL'
,
binds
=
[])
result
=
@connection
.
query
(
sql
)
result
=
@connection
.
query
(
sql
)
result_set
=
result
.
fetchall
result_set
=
result
.
fetch
_
all
columns
=
result
.
name_fields
columns
=
result
.
name_fields
types
=
result
.
type_fields
types
=
result
.
type_fields
ActiveRecord
::
Result
.
new
(
result_set
,
columns
,
types
)
ActiveRecord
::
Result
.
new
(
result_set
,
columns
,
types
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment