You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:as=>:hash,# the type of object you want each row back as; also supports :array (an array of values)
15
-
:async=>false,# don't wait for a result after sending the query, you'll have to monitor the socket yourself then eventually call Mysql2::Client#async_result
16
-
:cast_booleans=>false,# cast tinyint(1) fields as true/false in ruby
17
-
:symbolize_keys=>false,# return field names as symbols instead of strings
18
-
:database_timezone=>:local,# timezone Mysql2 will assume datetime objects are stored in
19
-
:application_timezone=>nil,# timezone Mysql2 will convert to before handing the object back to the caller
20
-
:cache_rows=>true,# tells Mysql2 to use it's internal row cache for results
21
-
:cast=>true# cast result fields to corresponding Ruby data types
22
-
}
23
7
24
8
definitialize(opts={})
25
9
opts=Mysql2::Util.key_hash_as_symbols(opts)
26
10
@read_timeout=nil# by default don't timeout on read
:connect_timeout=>120,# Set default connect_timeout to avoid unlimited retries from signal interruption
58
+
:encoding=>'utf8',
59
+
}
72
60
end
73
61
74
62
defself.default_query_options
75
-
@@default_query_options
63
+
@default_query_options ||= {
64
+
:as=>:hash,# the type of object you want each row back as; also supports :array (an array of values)
65
+
:async=>false,# don't wait for a result after sending the query, you'll have to monitor the socket yourself then eventually call Mysql2::Client#async_result
66
+
:cast_booleans=>false,# cast tinyint(1) fields as true/false in ruby
67
+
:symbolize_keys=>false,# return field names as symbols instead of strings
68
+
:database_timezone=>:local,# timezone Mysql2 will assume datetime objects are stored in
69
+
:application_timezone=>nil,# timezone Mysql2 will convert to before handing the object back to the caller
70
+
:cache_rows=>true,# tells Mysql2 to use it's internal row cache for results
71
+
:cast=>true,# cast result fields to corresponding Ruby data types
0 commit comments