roast-ai 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +2 -0
  3. data/.github/workflows/ci.yaml +1 -0
  4. data/.gitignore +0 -26
  5. data/.rubocop.yml +13 -0
  6. data/.rubocop_todo.yml +21 -0
  7. data/CHANGELOG.md +29 -0
  8. data/Gemfile +4 -0
  9. data/Gemfile.lock +43 -1
  10. data/bin/rubocop +27 -0
  11. data/bin/spoom +27 -0
  12. data/bin/srb +27 -0
  13. data/bin/srb-rbi +27 -0
  14. data/bin/tapioca +27 -0
  15. data/docs/INSTRUMENTATION.md +3 -3
  16. data/dsl/simple.rb +10 -0
  17. data/lib/roast/dsl/executor.rb +26 -0
  18. data/lib/roast/dsl.rb +7 -0
  19. data/lib/roast/errors.rb +1 -0
  20. data/lib/roast/factories/api_provider_factory.rb +1 -0
  21. data/lib/roast/helpers/function_caching_interceptor.rb +3 -0
  22. data/lib/roast/helpers/logger.rb +6 -9
  23. data/lib/roast/helpers/metadata_access.rb +1 -0
  24. data/lib/roast/helpers/minitest_coverage_runner.rb +1 -0
  25. data/lib/roast/helpers/path_resolver.rb +8 -18
  26. data/lib/roast/helpers/prompt_loader.rb +3 -2
  27. data/lib/roast/helpers/timeout_handler.rb +3 -5
  28. data/lib/roast/initializers.rb +1 -0
  29. data/lib/roast/resources/api_resource.rb +4 -3
  30. data/lib/roast/resources/base_resource.rb +1 -0
  31. data/lib/roast/resources/directory_resource.rb +1 -0
  32. data/lib/roast/resources/file_resource.rb +1 -0
  33. data/lib/roast/resources/none_resource.rb +1 -0
  34. data/lib/roast/resources/url_resource.rb +2 -1
  35. data/lib/roast/resources.rb +1 -2
  36. data/lib/roast/services/context_threshold_checker.rb +1 -0
  37. data/lib/roast/services/token_counting_service.rb +1 -0
  38. data/lib/roast/tools/apply_diff.rb +1 -0
  39. data/lib/roast/tools/ask_user.rb +1 -0
  40. data/lib/roast/tools/bash.rb +1 -0
  41. data/lib/roast/tools/cmd.rb +1 -0
  42. data/lib/roast/tools/coding_agent.rb +1 -0
  43. data/lib/roast/tools/context_summarizer.rb +1 -0
  44. data/lib/roast/tools/grep.rb +1 -0
  45. data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +1 -0
  46. data/lib/roast/tools/read_file.rb +1 -0
  47. data/lib/roast/tools/search_file.rb +1 -0
  48. data/lib/roast/tools/swarm.rb +1 -0
  49. data/lib/roast/tools/update_files.rb +1 -0
  50. data/lib/roast/tools/write_file.rb +1 -0
  51. data/lib/roast/tools.rb +2 -0
  52. data/lib/roast/value_objects/api_token.rb +1 -0
  53. data/lib/roast/value_objects/step_name.rb +1 -0
  54. data/lib/roast/value_objects/uri_base.rb +1 -0
  55. data/lib/roast/value_objects/workflow_path.rb +1 -0
  56. data/lib/roast/value_objects.rb +1 -0
  57. data/lib/roast/version.rb +2 -1
  58. data/lib/roast/workflow/agent_step.rb +1 -0
  59. data/lib/roast/workflow/api_configuration.rb +1 -0
  60. data/lib/roast/workflow/base_iteration_step.rb +1 -0
  61. data/lib/roast/workflow/base_step.rb +1 -0
  62. data/lib/roast/workflow/base_workflow.rb +1 -0
  63. data/lib/roast/workflow/case_executor.rb +1 -0
  64. data/lib/roast/workflow/case_step.rb +1 -0
  65. data/lib/roast/workflow/command_executor.rb +1 -0
  66. data/lib/roast/workflow/conditional_executor.rb +1 -0
  67. data/lib/roast/workflow/conditional_step.rb +1 -0
  68. data/lib/roast/workflow/configuration.rb +9 -0
  69. data/lib/roast/workflow/configuration_loader.rb +4 -1
  70. data/lib/roast/workflow/context_manager.rb +1 -0
  71. data/lib/roast/workflow/context_path_resolver.rb +1 -0
  72. data/lib/roast/workflow/dot_access_hash.rb +1 -0
  73. data/lib/roast/workflow/each_step.rb +1 -0
  74. data/lib/roast/workflow/error_handler.rb +7 -1
  75. data/lib/roast/workflow/expression_evaluator.rb +1 -0
  76. data/lib/roast/workflow/expression_utils.rb +1 -0
  77. data/lib/roast/workflow/file_state_repository.rb +2 -1
  78. data/lib/roast/workflow/input_executor.rb +1 -0
  79. data/lib/roast/workflow/input_step.rb +1 -0
  80. data/lib/roast/workflow/interpolator.rb +2 -1
  81. data/lib/roast/workflow/iteration_executor.rb +1 -0
  82. data/lib/roast/workflow/llm_boolean_coercer.rb +1 -0
  83. data/lib/roast/workflow/metadata_manager.rb +1 -0
  84. data/lib/roast/workflow/output_handler.rb +1 -0
  85. data/lib/roast/workflow/output_manager.rb +1 -0
  86. data/lib/roast/workflow/parallel_executor.rb +1 -0
  87. data/lib/roast/workflow/prompt_step.rb +1 -0
  88. data/lib/roast/workflow/repeat_step.rb +1 -0
  89. data/lib/roast/workflow/replay_handler.rb +1 -0
  90. data/lib/roast/workflow/resource_resolver.rb +2 -6
  91. data/lib/roast/workflow/session_manager.rb +1 -0
  92. data/lib/roast/workflow/shell_script_step.rb +1 -0
  93. data/lib/roast/workflow/sqlite_state_repository.rb +1 -0
  94. data/lib/roast/workflow/state_manager.rb +1 -0
  95. data/lib/roast/workflow/state_repository.rb +1 -0
  96. data/lib/roast/workflow/state_repository_factory.rb +4 -2
  97. data/lib/roast/workflow/step_completion_reporter.rb +1 -0
  98. data/lib/roast/workflow/step_executor_coordinator.rb +9 -5
  99. data/lib/roast/workflow/step_executor_factory.rb +1 -0
  100. data/lib/roast/workflow/step_executor_registry.rb +2 -3
  101. data/lib/roast/workflow/step_executor_with_reporting.rb +1 -0
  102. data/lib/roast/workflow/step_executors/base_step_executor.rb +1 -0
  103. data/lib/roast/workflow/step_executors/hash_step_executor.rb +1 -0
  104. data/lib/roast/workflow/step_executors/parallel_step_executor.rb +1 -0
  105. data/lib/roast/workflow/step_executors/string_step_executor.rb +1 -0
  106. data/lib/roast/workflow/step_factory.rb +1 -0
  107. data/lib/roast/workflow/step_finder.rb +1 -0
  108. data/lib/roast/workflow/step_loader.rb +1 -0
  109. data/lib/roast/workflow/step_name_extractor.rb +1 -0
  110. data/lib/roast/workflow/step_runner.rb +1 -0
  111. data/lib/roast/workflow/step_type_resolver.rb +1 -0
  112. data/lib/roast/workflow/validation_command.rb +1 -0
  113. data/lib/roast/workflow/validator.rb +1 -0
  114. data/lib/roast/workflow/validators/base_validator.rb +1 -0
  115. data/lib/roast/workflow/validators/dependency_validator.rb +1 -0
  116. data/lib/roast/workflow/validators/linting_validator.rb +1 -0
  117. data/lib/roast/workflow/validators/schema_validator.rb +1 -0
  118. data/lib/roast/workflow/validators/step_collector.rb +1 -0
  119. data/lib/roast/workflow/validators/validation_orchestrator.rb +1 -0
  120. data/lib/roast/workflow/workflow_context.rb +1 -0
  121. data/lib/roast/workflow/workflow_execution_context.rb +1 -0
  122. data/lib/roast/workflow/workflow_executor.rb +2 -1
  123. data/lib/roast/workflow/workflow_initializer.rb +1 -0
  124. data/lib/roast/workflow/workflow_runner.rb +66 -55
  125. data/lib/roast/workflow.rb +1 -0
  126. data/lib/roast/workflow_diagram_generator.rb +3 -2
  127. data/lib/roast.rb +23 -8
  128. data/sorbet/config +8 -0
  129. data/sorbet/rbi/dsl/.gitattributes +1 -0
  130. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  131. data/sorbet/rbi/gems/.gitattributes +1 -0
  132. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +19107 -0
  133. data/sorbet/rbi/gems/addressable@2.8.7.rbi +1994 -0
  134. data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
  135. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  136. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  137. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +62 -0
  138. data/sorbet/rbi/gems/cgi@0.5.0.rbi +2961 -0
  139. data/sorbet/rbi/gems/claude_swarm@0.1.19.rbi +568 -0
  140. data/sorbet/rbi/gems/cli-kit@5.0.1.rbi +1991 -0
  141. data/sorbet/rbi/gems/cli-ui@2.3.0.rbi +3181 -0
  142. data/sorbet/rbi/gems/coderay@1.1.3.rbi +9 -0
  143. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11657 -0
  144. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  145. data/sorbet/rbi/gems/crack@1.0.0.rbi +145 -0
  146. data/sorbet/rbi/gems/diff-lcs@1.6.2.rbi +972 -0
  147. data/sorbet/rbi/gems/dotenv@3.1.8.rbi +295 -0
  148. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  149. data/sorbet/rbi/gems/dry-configurable@1.3.0.rbi +672 -0
  150. data/sorbet/rbi/gems/dry-core@1.1.0.rbi +1894 -0
  151. data/sorbet/rbi/gems/dry-inflector@1.2.0.rbi +659 -0
  152. data/sorbet/rbi/gems/dry-initializer@3.2.0.rbi +781 -0
  153. data/sorbet/rbi/gems/dry-logic@1.6.0.rbi +1127 -0
  154. data/sorbet/rbi/gems/dry-schema@1.14.1.rbi +3727 -0
  155. data/sorbet/rbi/gems/dry-types@1.8.3.rbi +3969 -0
  156. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  157. data/sorbet/rbi/gems/event_stream_parser@1.0.0.rbi +49 -0
  158. data/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi +283 -0
  159. data/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi +147 -0
  160. data/sorbet/rbi/gems/faraday-retry@2.3.2.rbi +9 -0
  161. data/sorbet/rbi/gems/faraday@2.13.1.rbi +2977 -0
  162. data/sorbet/rbi/gems/fast-mcp-annotations@1.5.3.rbi +1588 -0
  163. data/sorbet/rbi/gems/ffi@1.17.2.rbi +9 -0
  164. data/sorbet/rbi/gems/formatador@1.1.0.rbi +9 -0
  165. data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +102 -0
  166. data/sorbet/rbi/gems/guard-minitest@2.4.6.rbi +402 -0
  167. data/sorbet/rbi/gems/guard@2.19.1.rbi +2283 -0
  168. data/sorbet/rbi/gems/hashdiff@1.2.0.rbi +355 -0
  169. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2359 -0
  170. data/sorbet/rbi/gems/json-schema@5.1.1.rbi +1466 -0
  171. data/sorbet/rbi/gems/json@2.12.2.rbi +2051 -0
  172. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  173. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +9 -0
  174. data/sorbet/rbi/gems/listen@3.9.0.rbi +1206 -0
  175. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  176. data/sorbet/rbi/gems/lumberjack@1.2.10.rbi +1830 -0
  177. data/sorbet/rbi/gems/method_source@1.1.0.rbi +9 -0
  178. data/sorbet/rbi/gems/mime-types-data@3.2025.0617.rbi +136 -0
  179. data/sorbet/rbi/gems/mime-types@3.7.0.rbi +1342 -0
  180. data/sorbet/rbi/gems/minitest-rg@5.3.0.rbi +160 -0
  181. data/sorbet/rbi/gems/minitest@5.25.5.rbi +1640 -0
  182. data/sorbet/rbi/gems/mocha@2.7.1.rbi +12 -0
  183. data/sorbet/rbi/gems/multipart-post@2.4.1.rbi +244 -0
  184. data/sorbet/rbi/gems/nenv@0.3.0.rbi +147 -0
  185. data/sorbet/rbi/gems/net-http@0.6.0.rbi +4247 -0
  186. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  187. data/sorbet/rbi/gems/notiffany@0.1.3.rbi +1079 -0
  188. data/sorbet/rbi/gems/open_router@0.3.3.rbi +230 -0
  189. data/sorbet/rbi/gems/ostruct@0.6.2.rbi +354 -0
  190. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  191. data/sorbet/rbi/gems/parser@3.3.8.0.rbi +5535 -0
  192. data/sorbet/rbi/gems/prism@1.4.0.rbi +41732 -0
  193. data/sorbet/rbi/gems/pry@0.15.2.rbi +9 -0
  194. data/sorbet/rbi/gems/public_suffix@6.0.2.rbi +936 -0
  195. data/sorbet/rbi/gems/racc@1.8.1.rbi +158 -0
  196. data/sorbet/rbi/gems/rack@2.2.17.rbi +5659 -0
  197. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +9 -0
  198. data/sorbet/rbi/gems/raix@1.0.2.rbi +1104 -0
  199. data/sorbet/rbi/gems/rake@13.3.0.rbi +3036 -0
  200. data/sorbet/rbi/gems/rb-fsevent@0.11.2.rbi +9 -0
  201. data/sorbet/rbi/gems/rb-inotify@0.11.1.rbi +9 -0
  202. data/sorbet/rbi/gems/rbi@0.3.6.rbi +6893 -0
  203. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6978 -0
  204. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +9 -0
  205. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5346 -0
  206. data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +9 -0
  207. data/sorbet/rbi/gems/rubocop-shopify@2.17.1.rbi +9 -0
  208. data/sorbet/rbi/gems/rubocop@1.77.0.rbi +9 -0
  209. data/sorbet/rbi/gems/ruby-graphviz@1.2.5.rbi +1333 -0
  210. data/sorbet/rbi/gems/ruby-openai@8.1.0.rbi +758 -0
  211. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +9 -0
  212. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
  213. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  214. data/sorbet/rbi/gems/shellany@0.0.1.rbi +102 -0
  215. data/sorbet/rbi/gems/spoom@1.6.3.rbi +6985 -0
  216. data/sorbet/rbi/gems/sqlite3@2.7.0.rbi +1900 -0
  217. data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
  218. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  219. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  220. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +9 -0
  221. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +9 -0
  222. data/sorbet/rbi/gems/uri@1.0.3.rbi +2349 -0
  223. data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
  224. data/sorbet/rbi/gems/webmock@3.25.1.rbi +1792 -0
  225. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  226. data/sorbet/rbi/gems/yard@0.9.37.rbi +18492 -0
  227. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1429 -0
  228. data/sorbet/tapioca/config.yml +13 -0
  229. data/sorbet/tapioca/require.rb +36 -0
  230. metadata +113 -2
  231. data/lib/roast/workflow/configuration_parser.rb +0 -54
@@ -0,0 +1,1900 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `sqlite3` gem.
5
+ # Please instead update this file by running `bin/tapioca gem sqlite3`.
6
+
7
+
8
+ module Process
9
+ extend ::SQLite3::ForkSafety::CoreExt
10
+ extend ::ActiveSupport::ForkTracker::CoreExt
11
+ end
12
+
13
+ # source://sqlite3//lib/sqlite3/constants.rb#1
14
+ module SQLite3
15
+ class << self
16
+ def libversion; end
17
+ def sqlcipher?; end
18
+ def status(*_arg0); end
19
+ def threadsafe; end
20
+
21
+ # Was sqlite3 compiled with thread safety on?
22
+ #
23
+ # @return [Boolean]
24
+ #
25
+ # source://sqlite3//lib/sqlite3.rb#14
26
+ def threadsafe?; end
27
+ end
28
+ end
29
+
30
+ # source://sqlite3//lib/sqlite3/errors.rb#43
31
+ class SQLite3::AbortException < ::SQLite3::Exception; end
32
+
33
+ # source://sqlite3//lib/sqlite3/errors.rb#81
34
+ class SQLite3::AuthorizationException < ::SQLite3::Exception; end
35
+
36
+ class SQLite3::Backup
37
+ def initialize(_arg0, _arg1, _arg2, _arg3); end
38
+
39
+ def finish; end
40
+ def pagecount; end
41
+ def remaining; end
42
+ def step(_arg0); end
43
+ end
44
+
45
+ class SQLite3::Blob < ::String; end
46
+
47
+ # source://sqlite3//lib/sqlite3/errors.rb#45
48
+ class SQLite3::BusyException < ::SQLite3::Exception; end
49
+
50
+ # source://sqlite3//lib/sqlite3/errors.rb#63
51
+ class SQLite3::CantOpenException < ::SQLite3::Exception; end
52
+
53
+ # source://sqlite3//lib/sqlite3/constants.rb#2
54
+ module SQLite3::Constants; end
55
+
56
+ # CAPI3REF: Fundamental Datatypes
57
+ #
58
+ # ^(Every value in SQLite has one of five fundamental datatypes:
59
+ #
60
+ # <ul>
61
+ # <li> 64-bit signed integer
62
+ # <li> 64-bit IEEE floating point number
63
+ # <li> string
64
+ # <li> BLOB
65
+ # <li> NULL
66
+ # </ul>)^
67
+ #
68
+ # These constants are codes for each of those types.
69
+ #
70
+ # source://sqlite3//lib/sqlite3/constants.rb#39
71
+ module SQLite3::Constants::ColumnType; end
72
+
73
+ # source://sqlite3//lib/sqlite3/constants.rb#43
74
+ SQLite3::Constants::ColumnType::BLOB = T.let(T.unsafe(nil), Integer)
75
+
76
+ # source://sqlite3//lib/sqlite3/constants.rb#41
77
+ SQLite3::Constants::ColumnType::FLOAT = T.let(T.unsafe(nil), Integer)
78
+
79
+ # source://sqlite3//lib/sqlite3/constants.rb#40
80
+ SQLite3::Constants::ColumnType::INTEGER = T.let(T.unsafe(nil), Integer)
81
+
82
+ # source://sqlite3//lib/sqlite3/constants.rb#44
83
+ SQLite3::Constants::ColumnType::NULL = T.let(T.unsafe(nil), Integer)
84
+
85
+ # source://sqlite3//lib/sqlite3/constants.rb#42
86
+ SQLite3::Constants::ColumnType::TEXT = T.let(T.unsafe(nil), Integer)
87
+
88
+ # CAPI3REF: Result Codes
89
+ #
90
+ # Many SQLite functions return an integer result code from the set shown
91
+ # here in order to indicate success or failure.
92
+ #
93
+ # New error codes may be added in future versions of SQLite.
94
+ #
95
+ # source://sqlite3//lib/sqlite3/constants.rb#55
96
+ module SQLite3::Constants::ErrorCode; end
97
+
98
+ # Callback routine requested an abort
99
+ #
100
+ # source://sqlite3//lib/sqlite3/constants.rb#65
101
+ SQLite3::Constants::ErrorCode::ABORT = T.let(T.unsafe(nil), Integer)
102
+
103
+ # Authorization denied
104
+ #
105
+ # source://sqlite3//lib/sqlite3/constants.rb#103
106
+ SQLite3::Constants::ErrorCode::AUTH = T.let(T.unsafe(nil), Integer)
107
+
108
+ # The database file is locked
109
+ #
110
+ # source://sqlite3//lib/sqlite3/constants.rb#67
111
+ SQLite3::Constants::ErrorCode::BUSY = T.let(T.unsafe(nil), Integer)
112
+
113
+ # Unable to open the database file
114
+ #
115
+ # source://sqlite3//lib/sqlite3/constants.rb#85
116
+ SQLite3::Constants::ErrorCode::CANTOPEN = T.let(T.unsafe(nil), Integer)
117
+
118
+ # Abort due to constraint violation
119
+ #
120
+ # source://sqlite3//lib/sqlite3/constants.rb#95
121
+ SQLite3::Constants::ErrorCode::CONSTRAINT = T.let(T.unsafe(nil), Integer)
122
+
123
+ # The database disk image is malformed
124
+ #
125
+ # source://sqlite3//lib/sqlite3/constants.rb#79
126
+ SQLite3::Constants::ErrorCode::CORRUPT = T.let(T.unsafe(nil), Integer)
127
+
128
+ # sqlite_step() has finished executing
129
+ #
130
+ # source://sqlite3//lib/sqlite3/constants.rb#117
131
+ SQLite3::Constants::ErrorCode::DONE = T.let(T.unsafe(nil), Integer)
132
+
133
+ # (Internal Only) Database table is empty
134
+ #
135
+ # source://sqlite3//lib/sqlite3/constants.rb#89
136
+ SQLite3::Constants::ErrorCode::EMPTY = T.let(T.unsafe(nil), Integer)
137
+
138
+ # SQL error or missing database
139
+ #
140
+ # source://sqlite3//lib/sqlite3/constants.rb#59
141
+ SQLite3::Constants::ErrorCode::ERROR = T.let(T.unsafe(nil), Integer)
142
+
143
+ # Not used
144
+ #
145
+ # source://sqlite3//lib/sqlite3/constants.rb#105
146
+ SQLite3::Constants::ErrorCode::FORMAT = T.let(T.unsafe(nil), Integer)
147
+
148
+ # Insertion failed because database is full
149
+ #
150
+ # source://sqlite3//lib/sqlite3/constants.rb#83
151
+ SQLite3::Constants::ErrorCode::FULL = T.let(T.unsafe(nil), Integer)
152
+
153
+ # An internal logic error in SQLite
154
+ #
155
+ # source://sqlite3//lib/sqlite3/constants.rb#61
156
+ SQLite3::Constants::ErrorCode::INTERNAL = T.let(T.unsafe(nil), Integer)
157
+
158
+ # Operation terminated by sqlite_interrupt()
159
+ #
160
+ # source://sqlite3//lib/sqlite3/constants.rb#75
161
+ SQLite3::Constants::ErrorCode::INTERRUPT = T.let(T.unsafe(nil), Integer)
162
+
163
+ # Some kind of disk I/O error occurred
164
+ #
165
+ # source://sqlite3//lib/sqlite3/constants.rb#77
166
+ SQLite3::Constants::ErrorCode::IOERR = T.let(T.unsafe(nil), Integer)
167
+
168
+ # A table in the database is locked
169
+ #
170
+ # source://sqlite3//lib/sqlite3/constants.rb#69
171
+ SQLite3::Constants::ErrorCode::LOCKED = T.let(T.unsafe(nil), Integer)
172
+
173
+ # Data type mismatch
174
+ #
175
+ # source://sqlite3//lib/sqlite3/constants.rb#97
176
+ SQLite3::Constants::ErrorCode::MISMATCH = T.let(T.unsafe(nil), Integer)
177
+
178
+ # Library used incorrectly
179
+ #
180
+ # source://sqlite3//lib/sqlite3/constants.rb#99
181
+ SQLite3::Constants::ErrorCode::MISUSE = T.let(T.unsafe(nil), Integer)
182
+
183
+ # Uses OS features not supported on host
184
+ #
185
+ # source://sqlite3//lib/sqlite3/constants.rb#101
186
+ SQLite3::Constants::ErrorCode::NOLFS = T.let(T.unsafe(nil), Integer)
187
+
188
+ # A malloc() failed
189
+ #
190
+ # source://sqlite3//lib/sqlite3/constants.rb#71
191
+ SQLite3::Constants::ErrorCode::NOMEM = T.let(T.unsafe(nil), Integer)
192
+
193
+ # File opened that is not a database file
194
+ #
195
+ # source://sqlite3//lib/sqlite3/constants.rb#109
196
+ SQLite3::Constants::ErrorCode::NOTADB = T.let(T.unsafe(nil), Integer)
197
+
198
+ # (Internal Only) Table or record not found
199
+ #
200
+ # source://sqlite3//lib/sqlite3/constants.rb#81
201
+ SQLite3::Constants::ErrorCode::NOTFOUND = T.let(T.unsafe(nil), Integer)
202
+
203
+ # Notifications from sqlite3_log()
204
+ #
205
+ # source://sqlite3//lib/sqlite3/constants.rb#111
206
+ SQLite3::Constants::ErrorCode::NOTICE = T.let(T.unsafe(nil), Integer)
207
+
208
+ # Successful result
209
+ #
210
+ # source://sqlite3//lib/sqlite3/constants.rb#57
211
+ SQLite3::Constants::ErrorCode::OK = T.let(T.unsafe(nil), Integer)
212
+
213
+ # Access permission denied
214
+ #
215
+ # source://sqlite3//lib/sqlite3/constants.rb#63
216
+ SQLite3::Constants::ErrorCode::PERM = T.let(T.unsafe(nil), Integer)
217
+
218
+ # Database lock protocol error
219
+ #
220
+ # source://sqlite3//lib/sqlite3/constants.rb#87
221
+ SQLite3::Constants::ErrorCode::PROTOCOL = T.let(T.unsafe(nil), Integer)
222
+
223
+ # 2nd parameter to sqlite3_bind out of range
224
+ #
225
+ # source://sqlite3//lib/sqlite3/constants.rb#107
226
+ SQLite3::Constants::ErrorCode::RANGE = T.let(T.unsafe(nil), Integer)
227
+
228
+ # Attempt to write a readonly database
229
+ #
230
+ # source://sqlite3//lib/sqlite3/constants.rb#73
231
+ SQLite3::Constants::ErrorCode::READONLY = T.let(T.unsafe(nil), Integer)
232
+
233
+ # sqlite_step() has another row ready
234
+ #
235
+ # source://sqlite3//lib/sqlite3/constants.rb#115
236
+ SQLite3::Constants::ErrorCode::ROW = T.let(T.unsafe(nil), Integer)
237
+
238
+ # The database schema changed
239
+ #
240
+ # source://sqlite3//lib/sqlite3/constants.rb#91
241
+ SQLite3::Constants::ErrorCode::SCHEMA = T.let(T.unsafe(nil), Integer)
242
+
243
+ # Too much data for one row of a table
244
+ #
245
+ # source://sqlite3//lib/sqlite3/constants.rb#93
246
+ SQLite3::Constants::ErrorCode::TOOBIG = T.let(T.unsafe(nil), Integer)
247
+
248
+ # Warnings from sqlite3_log()
249
+ #
250
+ # source://sqlite3//lib/sqlite3/constants.rb#113
251
+ SQLite3::Constants::ErrorCode::WARNING = T.let(T.unsafe(nil), Integer)
252
+
253
+ module SQLite3::Constants::Open; end
254
+ SQLite3::Constants::Open::AUTOPROXY = T.let(T.unsafe(nil), Integer)
255
+ SQLite3::Constants::Open::CREATE = T.let(T.unsafe(nil), Integer)
256
+ SQLite3::Constants::Open::DELETEONCLOSE = T.let(T.unsafe(nil), Integer)
257
+ SQLite3::Constants::Open::EXCLUSIVE = T.let(T.unsafe(nil), Integer)
258
+ SQLite3::Constants::Open::FULLMUTEX = T.let(T.unsafe(nil), Integer)
259
+ SQLite3::Constants::Open::MAIN_DB = T.let(T.unsafe(nil), Integer)
260
+ SQLite3::Constants::Open::MAIN_JOURNAL = T.let(T.unsafe(nil), Integer)
261
+ SQLite3::Constants::Open::MASTER_JOURNAL = T.let(T.unsafe(nil), Integer)
262
+ SQLite3::Constants::Open::MEMORY = T.let(T.unsafe(nil), Integer)
263
+ SQLite3::Constants::Open::NOMUTEX = T.let(T.unsafe(nil), Integer)
264
+ SQLite3::Constants::Open::PRIVATECACHE = T.let(T.unsafe(nil), Integer)
265
+ SQLite3::Constants::Open::READONLY = T.let(T.unsafe(nil), Integer)
266
+ SQLite3::Constants::Open::READWRITE = T.let(T.unsafe(nil), Integer)
267
+ SQLite3::Constants::Open::SHAREDCACHE = T.let(T.unsafe(nil), Integer)
268
+ SQLite3::Constants::Open::SUBJOURNAL = T.let(T.unsafe(nil), Integer)
269
+ SQLite3::Constants::Open::SUPER_JOURNAL = T.let(T.unsafe(nil), Integer)
270
+ SQLite3::Constants::Open::TEMP_DB = T.let(T.unsafe(nil), Integer)
271
+ SQLite3::Constants::Open::TEMP_JOURNAL = T.let(T.unsafe(nil), Integer)
272
+ SQLite3::Constants::Open::TRANSIENT_DB = T.let(T.unsafe(nil), Integer)
273
+ SQLite3::Constants::Open::URI = T.let(T.unsafe(nil), Integer)
274
+ SQLite3::Constants::Open::WAL = T.let(T.unsafe(nil), Integer)
275
+
276
+ # source://sqlite3//lib/sqlite3/constants.rb#174
277
+ module SQLite3::Constants::Optimize; end
278
+
279
+ # Run ANALYZE on tables that might benefit. On by default.
280
+ #
281
+ # source://sqlite3//lib/sqlite3/constants.rb#180
282
+ SQLite3::Constants::Optimize::ANALYZE_TABLES = T.let(T.unsafe(nil), Integer)
283
+
284
+ # Check the size of all tables, not just tables that have not been recently used, to see if
285
+ # any have grown and shrunk significantly and hence might benefit from being re-analyzed. Off
286
+ # by default.
287
+ #
288
+ # source://sqlite3//lib/sqlite3/constants.rb#189
289
+ SQLite3::Constants::Optimize::CHECK_ALL_TABLES = T.let(T.unsafe(nil), Integer)
290
+
291
+ # Debugging mode. Do not actually perform any optimizations but instead return one line of
292
+ # text for each optimization that would have been done. Off by default.
293
+ #
294
+ # source://sqlite3//lib/sqlite3/constants.rb#177
295
+ SQLite3::Constants::Optimize::DEBUG = T.let(T.unsafe(nil), Integer)
296
+
297
+ # Useful for adding a bit to the default behavior, for example
298
+ #
299
+ # db.optimize(Optimize::DEFAULT | Optimize::CHECK_ALL_TABLES)
300
+ #
301
+ # source://sqlite3//lib/sqlite3/constants.rb#195
302
+ SQLite3::Constants::Optimize::DEFAULT = T.let(T.unsafe(nil), Integer)
303
+
304
+ # When running ANALYZE, set a temporary PRAGMA analysis_limit to prevent excess run-time. On
305
+ # by default.
306
+ #
307
+ # source://sqlite3//lib/sqlite3/constants.rb#184
308
+ SQLite3::Constants::Optimize::LIMIT_ANALYZE = T.let(T.unsafe(nil), Integer)
309
+
310
+ # CAPI3REF: Status Parameters
311
+ #
312
+ # These integer constants designate various run-time status parameters
313
+ # that can be returned by SQLite3.status
314
+ #
315
+ # source://sqlite3//lib/sqlite3/constants.rb#126
316
+ module SQLite3::Constants::Status; end
317
+
318
+ # This parameter records the number of separate memory allocations currently checked out.
319
+ #
320
+ # source://sqlite3//lib/sqlite3/constants.rb#171
321
+ SQLite3::Constants::Status::MALLOC_COUNT = T.let(T.unsafe(nil), Integer)
322
+
323
+ # This parameter records the largest memory allocation request handed to sqlite3_malloc() or
324
+ # sqlite3_realloc() (or their internal equivalents). Only the value returned in the
325
+ # *pHighwater parameter to sqlite3_status() is of interest. The value written into the
326
+ # *pCurrent parameter is undefined.
327
+ #
328
+ # source://sqlite3//lib/sqlite3/constants.rb#155
329
+ SQLite3::Constants::Status::MALLOC_SIZE = T.let(T.unsafe(nil), Integer)
330
+
331
+ # This parameter is the current amount of memory checked out using sqlite3_malloc(), either
332
+ # directly or indirectly. The figure includes calls made to sqlite3_malloc() by the
333
+ # application and internal memory usage by the SQLite library. Auxiliary page-cache memory
334
+ # controlled by SQLITE_CONFIG_PAGECACHE is not included in this parameter. The amount returned
335
+ # is the sum of the allocation sizes as reported by the xSize method in sqlite3_mem_methods.
336
+ #
337
+ # source://sqlite3//lib/sqlite3/constants.rb#132
338
+ SQLite3::Constants::Status::MEMORY_USED = T.let(T.unsafe(nil), Integer)
339
+
340
+ # This parameter returns the number of bytes of page cache allocation which could not be
341
+ # satisfied by the SQLITE_CONFIG_PAGECACHE buffer and where forced to overflow to
342
+ # sqlite3_malloc(). The returned value includes allocations that overflowed because they where
343
+ # too large (they were larger than the "sz" parameter to SQLITE_CONFIG_PAGECACHE) and
344
+ # allocations that overflowed because no space was left in the page cache.
345
+ #
346
+ # source://sqlite3//lib/sqlite3/constants.rb#143
347
+ SQLite3::Constants::Status::PAGECACHE_OVERFLOW = T.let(T.unsafe(nil), Integer)
348
+
349
+ # This parameter records the largest memory allocation request handed to the pagecache memory
350
+ # allocator. Only the value returned in the *pHighwater parameter to sqlite3_status() is of
351
+ # interest. The value written into the *pCurrent parameter is undefined.
352
+ #
353
+ # source://sqlite3//lib/sqlite3/constants.rb#165
354
+ SQLite3::Constants::Status::PAGECACHE_SIZE = T.let(T.unsafe(nil), Integer)
355
+
356
+ # This parameter returns the number of pages used out of the pagecache memory allocator that
357
+ # was configured using SQLITE_CONFIG_PAGECACHE. The value returned is in pages, not in bytes.
358
+ #
359
+ # source://sqlite3//lib/sqlite3/constants.rb#136
360
+ SQLite3::Constants::Status::PAGECACHE_USED = T.let(T.unsafe(nil), Integer)
361
+
362
+ # The *pHighwater parameter records the deepest parser stack. The *pCurrent value is
363
+ # undefined. The *pHighwater value is only meaningful if SQLite is compiled with
364
+ # YYTRACKMAXSTACKDEPTH.
365
+ #
366
+ # source://sqlite3//lib/sqlite3/constants.rb#160
367
+ SQLite3::Constants::Status::PARSER_STACK = T.let(T.unsafe(nil), Integer)
368
+
369
+ # NOT USED
370
+ #
371
+ # source://sqlite3//lib/sqlite3/constants.rb#149
372
+ SQLite3::Constants::Status::SCRATCH_OVERFLOW = T.let(T.unsafe(nil), Integer)
373
+
374
+ # NOT USED
375
+ #
376
+ # source://sqlite3//lib/sqlite3/constants.rb#168
377
+ SQLite3::Constants::Status::SCRATCH_SIZE = T.let(T.unsafe(nil), Integer)
378
+
379
+ # NOT USED
380
+ #
381
+ # source://sqlite3//lib/sqlite3/constants.rb#146
382
+ SQLite3::Constants::Status::SCRATCH_USED = T.let(T.unsafe(nil), Integer)
383
+
384
+ # CAPI3REF: Text Encodings
385
+ #
386
+ # These constant define integer codes that represent the various
387
+ # text encodings supported by SQLite.
388
+ #
389
+ # source://sqlite3//lib/sqlite3/constants.rb#9
390
+ module SQLite3::Constants::TextRep; end
391
+
392
+ # Deprecated
393
+ #
394
+ # source://sqlite3//lib/sqlite3/constants.rb#19
395
+ SQLite3::Constants::TextRep::ANY = T.let(T.unsafe(nil), Integer)
396
+
397
+ # sqlite3_create_collation only
398
+ #
399
+ # source://sqlite3//lib/sqlite3/constants.rb#21
400
+ SQLite3::Constants::TextRep::DETERMINISTIC = T.let(T.unsafe(nil), Integer)
401
+
402
+ # Use native byte order
403
+ #
404
+ # source://sqlite3//lib/sqlite3/constants.rb#17
405
+ SQLite3::Constants::TextRep::UTF16 = T.let(T.unsafe(nil), Integer)
406
+
407
+ # IMP: R-51971-34154
408
+ #
409
+ # source://sqlite3//lib/sqlite3/constants.rb#15
410
+ SQLite3::Constants::TextRep::UTF16BE = T.let(T.unsafe(nil), Integer)
411
+
412
+ # IMP: R-03371-37637
413
+ #
414
+ # source://sqlite3//lib/sqlite3/constants.rb#13
415
+ SQLite3::Constants::TextRep::UTF16LE = T.let(T.unsafe(nil), Integer)
416
+
417
+ # IMP: R-37514-35566
418
+ #
419
+ # source://sqlite3//lib/sqlite3/constants.rb#11
420
+ SQLite3::Constants::TextRep::UTF8 = T.let(T.unsafe(nil), Integer)
421
+
422
+ # source://sqlite3//lib/sqlite3/errors.rb#73
423
+ class SQLite3::ConstraintException < ::SQLite3::Exception; end
424
+
425
+ # source://sqlite3//lib/sqlite3/errors.rb#57
426
+ class SQLite3::CorruptException < ::SQLite3::Exception; end
427
+
428
+ # == Overview
429
+ #
430
+ # The Database class encapsulates a single connection to a SQLite3 database. Here's a
431
+ # straightforward example of usage:
432
+ #
433
+ # require 'sqlite3'
434
+ #
435
+ # SQLite3::Database.new( "data.db" ) do |db|
436
+ # db.execute( "select * from table" ) do |row|
437
+ # p row
438
+ # end
439
+ # end
440
+ #
441
+ # It wraps the lower-level methods provided by the selected driver, and includes the Pragmas
442
+ # module for access to various pragma convenience methods.
443
+ #
444
+ # The Database class provides type translation services as well, by which the SQLite3 data types
445
+ # (which are all represented as strings) may be converted into their corresponding types (as
446
+ # defined in the schemas for their tables). This translation only occurs when querying data from
447
+ # the database--insertions and updates are all still typeless.
448
+ #
449
+ # Furthermore, the Database class has been designed to work well with the ArrayFields module from
450
+ # Ara Howard. If you require the ArrayFields module before performing a query, and if you have not
451
+ # enabled results as hashes, then the results will all be indexible by field name.
452
+ #
453
+ # == Thread safety
454
+ #
455
+ # When SQLite3.threadsafe? returns true, it is safe to share instances of the database class
456
+ # among threads without adding specific locking. Other object instances may require applications
457
+ # to provide their own locks if they are to be shared among threads. Please see the README.md for
458
+ # more information.
459
+ #
460
+ # == SQLite Extensions
461
+ #
462
+ # SQLite3::Database supports the universe of {sqlite
463
+ # extensions}[https://www.sqlite.org/loadext.html]. It's possible to load an extension into an
464
+ # existing Database object using the #load_extension method and passing a filesystem path:
465
+ #
466
+ # db = SQLite3::Database.new(":memory:")
467
+ # db.enable_load_extension(true)
468
+ # db.load_extension("/path/to/extension")
469
+ #
470
+ # As of v2.4.0, it's also possible to pass an object that responds to +#to_path+. This
471
+ # documentation will refer to the supported interface as +_ExtensionSpecifier+, which can be
472
+ # expressed in RBS syntax as:
473
+ #
474
+ # interface _ExtensionSpecifier
475
+ # def to_path: () → String
476
+ # end
477
+ #
478
+ # So, for example, if you are using the {sqlean gem}[https://github.com/flavorjones/sqlean-ruby]
479
+ # which provides modules that implement this interface, you can pass the module directly:
480
+ #
481
+ # db = SQLite3::Database.new(":memory:")
482
+ # db.enable_load_extension(true)
483
+ # db.load_extension(SQLean::Crypto)
484
+ #
485
+ # It's also possible in v2.4.0+ to load extensions via the SQLite3::Database constructor by using
486
+ # the +extensions:+ keyword argument to pass an array of String paths or extension specifiers:
487
+ #
488
+ # db = SQLite3::Database.new(":memory:", extensions: ["/path/to/extension", SQLean::Crypto])
489
+ #
490
+ # Note that when loading extensions via the constructor, there is no need to call
491
+ # #enable_load_extension; however it is still necessary to call #enable_load_extensions before any
492
+ # subsequently invocations of #load_extension on the initialized Database object.
493
+ #
494
+ # You can load extensions in a Rails application by using the +extensions:+ configuration option:
495
+ #
496
+ # # config/database.yml
497
+ # development:
498
+ # adapter: sqlite3
499
+ # extensions:
500
+ # - .sqlpkg/nalgeon/crypto/crypto.so # a filesystem path
501
+ # - <%= SQLean::UUID.to_path %> # or ruby code returning a path
502
+ # - SQLean::Crypto # Rails 8.1+ accepts the name of a constant that responds to `to_path`
503
+ #
504
+ # source://sqlite3//lib/sqlite3/database.rb#87
505
+ class SQLite3::Database
506
+ include ::SQLite3::Pragmas
507
+
508
+ # call-seq:
509
+ # SQLite3::Database.new(file, options = {})
510
+ #
511
+ # Create a new Database object that opens the given file.
512
+ #
513
+ # Supported permissions +options+:
514
+ # - the default mode is <tt>READWRITE | CREATE</tt>
515
+ # - +readonly:+ boolean (default false), true to set the mode to +READONLY+
516
+ # - +readwrite:+ boolean (default false), true to set the mode to +READWRITE+
517
+ # - +flags:+ set the mode to a combination of SQLite3::Constants::Open flags.
518
+ #
519
+ # Supported encoding +options+:
520
+ # - +utf16:+ +boolish+ (default false), is the filename's encoding UTF-16 (only needed if the filename encoding is not UTF_16LE or BE)
521
+ #
522
+ # Other supported +options+:
523
+ # - +strict:+ +boolish+ (default false), disallow the use of double-quoted string literals (see https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted)
524
+ # - +results_as_hash:+ +boolish+ (default false), return rows as hashes instead of arrays
525
+ # - +default_transaction_mode:+ one of +:deferred+ (default), +:immediate+, or +:exclusive+. If a mode is not specified in a call to #transaction, this will be the default transaction mode.
526
+ # - +extensions:+ <tt>Array[String | _ExtensionSpecifier]</tt> SQLite extensions to load into the database. See Database@SQLite+Extensions for more information.
527
+ #
528
+ # @return [Database] a new instance of Database
529
+ #
530
+ # source://sqlite3//lib/sqlite3/database.rb#142
531
+ def initialize(file, options = T.unsafe(nil), zvfs = T.unsafe(nil)); end
532
+
533
+ # Installs (or removes) a block that will be invoked for every access
534
+ # to the database. If the block returns 0 (or +nil+), the statement
535
+ # is allowed to proceed. Returning 1 causes an authorization error to
536
+ # occur, and returning 2 causes the access to be silently denied.
537
+ #
538
+ # source://sqlite3//lib/sqlite3/database.rb#207
539
+ def authorizer(&block); end
540
+
541
+ def authorizer=(_arg0); end
542
+
543
+ # Given a statement, return a result set.
544
+ # This is not intended for general consumption
545
+ #
546
+ # source://sqlite3//lib/sqlite3/database.rb#790
547
+ def build_result_set(stmt); end
548
+
549
+ def busy_handler(*_arg0); end
550
+
551
+ # Sets a #busy_handler that releases the GVL between retries,
552
+ # but only retries up to the indicated number of +milliseconds+.
553
+ # This is an alternative to #busy_timeout, which holds the GVL
554
+ # while SQLite sleeps and retries.
555
+ #
556
+ # source://sqlite3//lib/sqlite3/database.rb#693
557
+ def busy_handler_timeout=(milliseconds); end
558
+
559
+ def busy_timeout(_arg0); end
560
+ def busy_timeout=(_arg0); end
561
+ def changes; end
562
+ def close; end
563
+ def closed?; end
564
+ def collation(_arg0, _arg1); end
565
+
566
+ # Returns the value of attribute collations.
567
+ #
568
+ # source://sqlite3//lib/sqlite3/database.rb#88
569
+ def collations; end
570
+
571
+ # Commits the current transaction. If there is no current transaction,
572
+ # this will cause an error to be raised. This returns +true+, in order
573
+ # to allow it to be used in idioms like
574
+ # <tt>abort? and rollback or commit</tt>.
575
+ #
576
+ # source://sqlite3//lib/sqlite3/database.rb#669
577
+ def commit; end
578
+
579
+ def complete?(_arg0); end
580
+
581
+ # Creates a new aggregate function for use in SQL statements. Aggregate
582
+ # functions are functions that apply over every row in the result set,
583
+ # instead of over just a single row. (A very common aggregate function
584
+ # is the "count" function, for determining the number of rows that match
585
+ # a query.)
586
+ #
587
+ # The new function will be added as +name+, with the given +arity+. (For
588
+ # variable arity functions, use -1 for the arity.)
589
+ #
590
+ # The +step+ parameter must be a proc object that accepts as its first
591
+ # parameter a FunctionProxy instance (representing the function
592
+ # invocation), with any subsequent parameters (up to the function's arity).
593
+ # The +step+ callback will be invoked once for each row of the result set.
594
+ #
595
+ # The +finalize+ parameter must be a +proc+ object that accepts only a
596
+ # single parameter, the FunctionProxy instance representing the current
597
+ # function invocation. It should invoke FunctionProxy#result= to
598
+ # store the result of the function.
599
+ #
600
+ # Example:
601
+ #
602
+ # db.create_aggregate( "lengths", 1 ) do
603
+ # step do |func, value|
604
+ # func[ :total ] ||= 0
605
+ # func[ :total ] += ( value ? value.length : 0 )
606
+ # end
607
+ #
608
+ # finalize do |func|
609
+ # func.result = func[ :total ] || 0
610
+ # end
611
+ # end
612
+ #
613
+ # puts db.get_first_value( "select lengths(name) from table" )
614
+ #
615
+ # See also #create_aggregate_handler for a more object-oriented approach to
616
+ # aggregate functions.
617
+ #
618
+ # source://sqlite3//lib/sqlite3/database.rb#457
619
+ def create_aggregate(name, arity, step = T.unsafe(nil), finalize = T.unsafe(nil), text_rep = T.unsafe(nil), &block); end
620
+
621
+ # This is another approach to creating an aggregate function (see
622
+ # #create_aggregate). Instead of explicitly specifying the name,
623
+ # callbacks, arity, and type, you specify a factory object
624
+ # (the "handler") that knows how to obtain all of that information. The
625
+ # handler should respond to the following messages:
626
+ #
627
+ # +arity+:: corresponds to the +arity+ parameter of #create_aggregate. This
628
+ # message is optional, and if the handler does not respond to it,
629
+ # the function will have an arity of -1.
630
+ # +name+:: this is the name of the function. The handler _must_ implement
631
+ # this message.
632
+ # +new+:: this must be implemented by the handler. It should return a new
633
+ # instance of the object that will handle a specific invocation of
634
+ # the function.
635
+ #
636
+ # The handler instance (the object returned by the +new+ message, described
637
+ # above), must respond to the following messages:
638
+ #
639
+ # +step+:: this is the method that will be called for each step of the
640
+ # aggregate function's evaluation. It should implement the same
641
+ # signature as the +step+ callback for #create_aggregate.
642
+ # +finalize+:: this is the method that will be called to finalize the
643
+ # aggregate function's evaluation. It should implement the
644
+ # same signature as the +finalize+ callback for
645
+ # #create_aggregate.
646
+ #
647
+ # Example:
648
+ #
649
+ # class LengthsAggregateHandler
650
+ # def self.arity; 1; end
651
+ # def self.name; 'lengths'; end
652
+ #
653
+ # def initialize
654
+ # @total = 0
655
+ # end
656
+ #
657
+ # def step( ctx, name )
658
+ # @total += ( name ? name.length : 0 )
659
+ # end
660
+ #
661
+ # def finalize( ctx )
662
+ # ctx.result = @total
663
+ # end
664
+ # end
665
+ #
666
+ # db.create_aggregate_handler( LengthsAggregateHandler )
667
+ # puts db.get_first_value( "select lengths(name) from A" )
668
+ #
669
+ # source://sqlite3//lib/sqlite3/database.rb#555
670
+ def create_aggregate_handler(handler); end
671
+
672
+ # Creates a new function for use in SQL statements. It will be added as
673
+ # +name+, with the given +arity+. (For variable arity functions, use
674
+ # -1 for the arity.)
675
+ #
676
+ # The block should accept at least one parameter--the FunctionProxy
677
+ # instance that wraps this function invocation--and any other
678
+ # arguments it needs (up to its arity).
679
+ #
680
+ # The block does not return a value directly. Instead, it will invoke
681
+ # the FunctionProxy#result= method on the +func+ parameter and
682
+ # indicate the return value that way.
683
+ #
684
+ # Example:
685
+ #
686
+ # db.create_function( "maim", 1 ) do |func, value|
687
+ # if value.nil?
688
+ # func.result = nil
689
+ # else
690
+ # func.result = value.split(//).sort.join
691
+ # end
692
+ # end
693
+ #
694
+ # puts db.get_first_value( "select maim(name) from table" )
695
+ #
696
+ # source://sqlite3//lib/sqlite3/database.rb#412
697
+ def create_function(name, arity, text_rep = T.unsafe(nil), &block); end
698
+
699
+ # Define an aggregate function named +name+ using a object template
700
+ # object +aggregator+. +aggregator+ must respond to +step+ and +finalize+.
701
+ # +step+ will be called with row information and +finalize+ must return the
702
+ # return value for the aggregator function.
703
+ #
704
+ # _API Change:_ +aggregator+ must also implement +clone+. The provided
705
+ # +aggregator+ object will serve as template that is cloned to provide the
706
+ # individual instances of the aggregate function. Regular ruby objects
707
+ # already provide a suitable +clone+.
708
+ # The functions arity is the arity of the +step+ method.
709
+ #
710
+ # source://sqlite3//lib/sqlite3/database.rb#592
711
+ def define_aggregator(name, aggregator); end
712
+
713
+ def define_function(_arg0); end
714
+ def define_function_with_flags(_arg0, _arg1); end
715
+ def enable_load_extension(_arg0); end
716
+
717
+ # call-seq: db.encoding
718
+ #
719
+ # Fetch the encoding set on this database
720
+ #
721
+ # source://sqlite3//lib/sqlite3/database.rb#199
722
+ def encoding; end
723
+
724
+ def errcode; end
725
+ def errmsg; end
726
+
727
+ # Executes the given SQL statement. If additional parameters are given,
728
+ # they are treated as bind variables, and are bound to the placeholders in
729
+ # the query.
730
+ #
731
+ # Note that if any of the values passed to this are hashes, then the
732
+ # key/value pairs are each bound separately, with the key being used as
733
+ # the name of the placeholder to bind the value to.
734
+ #
735
+ # The block is optional. If given, it will be invoked for each row returned
736
+ # by the query. Otherwise, any results are accumulated into an array and
737
+ # returned wholesale.
738
+ #
739
+ # See also #execute2, #query, and #execute_batch for additional ways of
740
+ # executing statements.
741
+ #
742
+ # source://sqlite3//lib/sqlite3/database.rb#248
743
+ def execute(sql, bind_vars = T.unsafe(nil), &block); end
744
+
745
+ # Executes the given SQL statement, exactly as with #execute. However, the
746
+ # first row returned (either via the block, or in the returned array) is
747
+ # always the names of the columns. Subsequent rows correspond to the data
748
+ # from the result set.
749
+ #
750
+ # Thus, even if the query itself returns no rows, this method will always
751
+ # return at least one row--the names of the columns.
752
+ #
753
+ # See also #execute, #query, and #execute_batch for additional ways of
754
+ # executing statements.
755
+ #
756
+ # source://sqlite3//lib/sqlite3/database.rb#273
757
+ def execute2(sql, *bind_vars); end
758
+
759
+ # Executes all SQL statements in the given string. By contrast, the other
760
+ # means of executing queries will only execute the first statement in the
761
+ # string, ignoring all subsequent statements. This will execute each one
762
+ # in turn. The same bind parameters, if given, will be applied to each
763
+ # statement.
764
+ #
765
+ # This always returns the result of the last statement.
766
+ #
767
+ # See also #execute_batch2 for additional ways of
768
+ # executing statements.
769
+ #
770
+ # source://sqlite3//lib/sqlite3/database.rb#297
771
+ def execute_batch(sql, bind_vars = T.unsafe(nil)); end
772
+
773
+ # Executes all SQL statements in the given string. By contrast, the other
774
+ # means of executing queries will only execute the first statement in the
775
+ # string, ignoring all subsequent statements. This will execute each one
776
+ # in turn. Bind parameters cannot be passed to #execute_batch2.
777
+ #
778
+ # If a query is made, all values will be returned as strings.
779
+ # If no query is made, an empty array will be returned.
780
+ #
781
+ # Because all values except for 'NULL' are returned as strings,
782
+ # a block can be passed to parse the values accordingly.
783
+ #
784
+ # See also #execute_batch for additional ways of
785
+ # executing statements.
786
+ #
787
+ # source://sqlite3//lib/sqlite3/database.rb#330
788
+ def execute_batch2(sql, &block); end
789
+
790
+ def extended_result_codes=(_arg0); end
791
+
792
+ # Returns the filename for the database named +db_name+. +db_name+ defaults
793
+ # to "main". Main return `nil` or an empty string if the database is
794
+ # temporary or in-memory.
795
+ #
796
+ # source://sqlite3//lib/sqlite3/database.rb#230
797
+ def filename(db_name = T.unsafe(nil)); end
798
+
799
+ # A convenience method for obtaining the first row of a result set, and
800
+ # discarding all others. It is otherwise identical to #execute.
801
+ #
802
+ # See also #get_first_value.
803
+ #
804
+ # source://sqlite3//lib/sqlite3/database.rb#369
805
+ def get_first_row(sql, *bind_vars); end
806
+
807
+ # A convenience method for obtaining the first value of the first row of a
808
+ # result set, and discarding all other values and rows. It is otherwise
809
+ # identical to #execute.
810
+ #
811
+ # See also #get_first_row.
812
+ #
813
+ # source://sqlite3//lib/sqlite3/database.rb#378
814
+ def get_first_value(sql, *bind_vars); end
815
+
816
+ # @raise [TypeError]
817
+ #
818
+ # source://sqlite3//lib/sqlite3/database.rb#738
819
+ def initialize_extensions(extensions); end
820
+
821
+ def interrupt; end
822
+ def last_insert_row_id; end
823
+
824
+ # call-seq:
825
+ # load_extension(extension_specifier) -> self
826
+ #
827
+ # Loads an SQLite extension library from the named file. Extension loading must be enabled using
828
+ # #enable_load_extension prior to using this method.
829
+ #
830
+ # See also: Database@SQLite+Extensions
831
+ #
832
+ # [Parameters]
833
+ # - +extension_specifier+: (String | +_ExtensionSpecifier+) If a String, it is the filesystem path
834
+ # to the sqlite extension file. If an object that responds to #to_path, the
835
+ # return value of that method is used as the filesystem path to the sqlite extension file.
836
+ #
837
+ # [Example] Using a filesystem path:
838
+ #
839
+ # db.load_extension("/path/to/my_extension.so")
840
+ #
841
+ # [Example] Using the {sqlean gem}[https://github.com/flavorjones/sqlean-ruby]:
842
+ #
843
+ # db.load_extension(SQLean::VSV)
844
+ #
845
+ # source://sqlite3//lib/sqlite3/database.rb#729
846
+ def load_extension(extension_specifier); end
847
+
848
+ # Returns a Statement object representing the given SQL. This does not
849
+ # execute the statement; it merely prepares the statement for execution.
850
+ #
851
+ # The Statement can then be executed using Statement#execute.
852
+ #
853
+ # source://sqlite3//lib/sqlite3/database.rb#216
854
+ def prepare(sql); end
855
+
856
+ # This is a convenience method for creating a statement, binding
857
+ # parameters to it, and calling execute:
858
+ #
859
+ # result = db.query( "select * from foo where a=?", [5])
860
+ # # is the same as
861
+ # result = db.prepare( "select * from foo where a=?" ).execute( 5 )
862
+ #
863
+ # You must be sure to call +close+ on the ResultSet instance that is
864
+ # returned, or you could have problems with locks on the table. If called
865
+ # with a block, +close+ will be invoked implicitly when the block
866
+ # terminates.
867
+ #
868
+ # source://sqlite3//lib/sqlite3/database.rb#352
869
+ def query(sql, bind_vars = T.unsafe(nil)); end
870
+
871
+ # Returns +true+ if the database has been open in readonly mode
872
+ # A helper to check before performing any operation
873
+ #
874
+ # @return [Boolean]
875
+ #
876
+ # source://sqlite3//lib/sqlite3/database.rb#685
877
+ def readonly?; end
878
+
879
+ # A boolean that indicates whether rows in result sets should be returned
880
+ # as hashes or not. By default, rows are returned as arrays.
881
+ #
882
+ # source://sqlite3//lib/sqlite3/database.rb#120
883
+ def results_as_hash; end
884
+
885
+ # A boolean that indicates whether rows in result sets should be returned
886
+ # as hashes or not. By default, rows are returned as arrays.
887
+ #
888
+ # source://sqlite3//lib/sqlite3/database.rb#120
889
+ def results_as_hash=(_arg0); end
890
+
891
+ # Rolls the current transaction back. If there is no current transaction,
892
+ # this will cause an error to be raised. This returns +true+, in order
893
+ # to allow it to be used in idioms like
894
+ # <tt>abort? and rollback or commit</tt>.
895
+ #
896
+ # source://sqlite3//lib/sqlite3/database.rb#678
897
+ def rollback; end
898
+
899
+ def statement_timeout=(_arg0); end
900
+ def total_changes; end
901
+ def trace(*_arg0); end
902
+
903
+ # Begins a new transaction. Note that nested transactions are not allowed
904
+ # by SQLite, so attempting to nest a transaction will result in a runtime
905
+ # exception.
906
+ #
907
+ # The +mode+ parameter may be either <tt>:deferred</tt>,
908
+ # <tt>:immediate</tt>, or <tt>:exclusive</tt>.
909
+ # If `nil` is specified, the default transaction mode, which was
910
+ # passed to #initialize, is used.
911
+ #
912
+ # If a block is given, the database instance is yielded to it, and the
913
+ # transaction is committed when the block terminates. If the block
914
+ # raises an exception, a rollback will be performed instead. Note that if
915
+ # a block is given, #commit and #rollback should never be called
916
+ # explicitly or you'll get an error when the block terminates.
917
+ #
918
+ # If a block is not given, it is the caller's responsibility to end the
919
+ # transaction explicitly, either by calling #commit, or by calling
920
+ # #rollback.
921
+ #
922
+ # source://sqlite3//lib/sqlite3/database.rb#646
923
+ def transaction(mode = T.unsafe(nil)); end
924
+
925
+ def transaction_active?; end
926
+
927
+ private
928
+
929
+ def db_filename(_arg0); end
930
+ def define_aggregator2(_arg0, _arg1); end
931
+ def disable_quirk_mode; end
932
+ def discard; end
933
+ def exec_batch(_arg0, _arg1); end
934
+ def load_extension_internal(_arg0); end
935
+ def open16(_arg0); end
936
+ def open_v2(_arg0, _arg1, _arg2); end
937
+
938
+ class << self
939
+ # Without block works exactly as new.
940
+ # With block, like new closes the database at the end, but unlike new
941
+ # returns the result of the block instead of the database instance.
942
+ #
943
+ # source://sqlite3//lib/sqlite3/database.rb#96
944
+ def open(*args); end
945
+
946
+ # Quotes the given string, making it safe to use in an SQL statement.
947
+ # It replaces all instances of the single-quote character with two
948
+ # single-quote characters. The modified string is returned.
949
+ #
950
+ # source://sqlite3//lib/sqlite3/database.rb#113
951
+ def quote(string); end
952
+ end
953
+ end
954
+
955
+ # A helper class for dealing with custom functions (see #create_function,
956
+ # #create_aggregate, and #create_aggregate_handler). It encapsulates the
957
+ # opaque function object that represents the current invocation. It also
958
+ # provides more convenient access to the API functions that operate on
959
+ # the function object.
960
+ #
961
+ # This class will almost _always_ be instantiated indirectly, by working
962
+ # with the create methods mentioned above.
963
+ #
964
+ # source://sqlite3//lib/sqlite3/database.rb#762
965
+ class SQLite3::Database::FunctionProxy
966
+ # Create a new FunctionProxy that encapsulates the given +func+ object.
967
+ # If context is non-nil, the functions context will be set to that. If
968
+ # it is non-nil, it must quack like a Hash. If it is nil, then none of
969
+ # the context functions will be available.
970
+ #
971
+ # @return [FunctionProxy] a new instance of FunctionProxy
972
+ #
973
+ # source://sqlite3//lib/sqlite3/database.rb#769
974
+ def initialize; end
975
+
976
+ # Returns the value with the given key from the context. This is only
977
+ # available to aggregate functions.
978
+ #
979
+ # source://sqlite3//lib/sqlite3/database.rb#776
980
+ def [](key); end
981
+
982
+ # Sets the value with the given key in the context. This is only
983
+ # available to aggregate functions.
984
+ #
985
+ # source://sqlite3//lib/sqlite3/database.rb#782
986
+ def []=(key, value); end
987
+
988
+ # Returns the value of attribute result.
989
+ #
990
+ # source://sqlite3//lib/sqlite3/database.rb#763
991
+ def result; end
992
+
993
+ # Sets the attribute result
994
+ #
995
+ # @param value the value to set the attribute result to.
996
+ #
997
+ # source://sqlite3//lib/sqlite3/database.rb#763
998
+ def result=(_arg0); end
999
+ end
1000
+
1001
+ # source://sqlite3//lib/sqlite3/errors.rb#67
1002
+ class SQLite3::EmptyException < ::SQLite3::Exception; end
1003
+
1004
+ # source://sqlite3//lib/sqlite3/errors.rb#4
1005
+ class SQLite3::Exception < ::StandardError
1006
+ # A convenience for accessing the error code for this exception.
1007
+ #
1008
+ # source://sqlite3//lib/sqlite3/errors.rb#6
1009
+ def code; end
1010
+
1011
+ # source://sqlite3//lib/sqlite3/errors.rb#15
1012
+ def message; end
1013
+
1014
+ # If the error is associated with a SQL query, this is the query
1015
+ #
1016
+ # source://sqlite3//lib/sqlite3/errors.rb#9
1017
+ def sql; end
1018
+
1019
+ # If the error is associated with a particular offset in a SQL query, this is the non-negative
1020
+ # offset. If the offset is not available, this will be -1.
1021
+ #
1022
+ # source://sqlite3//lib/sqlite3/errors.rb#13
1023
+ def sql_offset; end
1024
+
1025
+ private
1026
+
1027
+ # source://sqlite3//lib/sqlite3/errors.rb#19
1028
+ def sql_error; end
1029
+ end
1030
+
1031
+ # based on Rails's active_support/fork_tracker.rb
1032
+ #
1033
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#7
1034
+ module SQLite3::ForkSafety
1035
+ class << self
1036
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#33
1037
+ def discard; end
1038
+
1039
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#23
1040
+ def hook!; end
1041
+
1042
+ # Call to suppress the fork-related warnings.
1043
+ #
1044
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#59
1045
+ def suppress_warnings!; end
1046
+
1047
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#27
1048
+ def track(database); end
1049
+ end
1050
+ end
1051
+
1052
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#8
1053
+ module SQLite3::ForkSafety::CoreExt
1054
+ # source://sqlite3//lib/sqlite3/fork_safety.rb#9
1055
+ def _fork; end
1056
+ end
1057
+
1058
+ # source://sqlite3//lib/sqlite3/errors.rb#83
1059
+ class SQLite3::FormatException < ::SQLite3::Exception; end
1060
+
1061
+ # source://sqlite3//lib/sqlite3/errors.rb#61
1062
+ class SQLite3::FullException < ::SQLite3::Exception; end
1063
+
1064
+ # source://sqlite3//lib/sqlite3/resultset.rb#93
1065
+ class SQLite3::HashResultSet < ::SQLite3::ResultSet
1066
+ # source://sqlite3//lib/sqlite3/resultset.rb#85
1067
+ def next; end
1068
+ end
1069
+
1070
+ # source://sqlite3//lib/sqlite3/errors.rb#55
1071
+ class SQLite3::IOException < ::SQLite3::Exception; end
1072
+
1073
+ # source://sqlite3//lib/sqlite3/errors.rb#39
1074
+ class SQLite3::InternalException < ::SQLite3::Exception; end
1075
+
1076
+ # source://sqlite3//lib/sqlite3/errors.rb#53
1077
+ class SQLite3::InterruptException < ::SQLite3::Exception; end
1078
+
1079
+ # source://sqlite3//lib/sqlite3/errors.rb#47
1080
+ class SQLite3::LockedException < ::SQLite3::Exception; end
1081
+
1082
+ # source://sqlite3//lib/sqlite3/errors.rb#49
1083
+ class SQLite3::MemoryException < ::SQLite3::Exception; end
1084
+
1085
+ # source://sqlite3//lib/sqlite3/errors.rb#75
1086
+ class SQLite3::MismatchException < ::SQLite3::Exception; end
1087
+
1088
+ # source://sqlite3//lib/sqlite3/errors.rb#77
1089
+ class SQLite3::MisuseException < ::SQLite3::Exception; end
1090
+
1091
+ # source://sqlite3//lib/sqlite3/errors.rb#87
1092
+ class SQLite3::NotADatabaseException < ::SQLite3::Exception; end
1093
+
1094
+ # source://sqlite3//lib/sqlite3/errors.rb#59
1095
+ class SQLite3::NotFoundException < ::SQLite3::Exception; end
1096
+
1097
+ # source://sqlite3//lib/sqlite3/errors.rb#41
1098
+ class SQLite3::PermissionException < ::SQLite3::Exception; end
1099
+
1100
+ # This module is intended for inclusion solely by the Database class. It
1101
+ # defines convenience methods for the various pragmas supported by SQLite3.
1102
+ #
1103
+ # For a detailed description of these pragmas, see the SQLite3 documentation
1104
+ # at http://sqlite.org/pragma.html.
1105
+ #
1106
+ # source://sqlite3//lib/sqlite3/pragmas.rb#11
1107
+ module SQLite3::Pragmas
1108
+ # source://sqlite3//lib/sqlite3/pragmas.rb#143
1109
+ def application_id; end
1110
+
1111
+ # source://sqlite3//lib/sqlite3/pragmas.rb#147
1112
+ def application_id=(integer); end
1113
+
1114
+ # source://sqlite3//lib/sqlite3/pragmas.rb#151
1115
+ def auto_vacuum; end
1116
+
1117
+ # source://sqlite3//lib/sqlite3/pragmas.rb#155
1118
+ def auto_vacuum=(mode); end
1119
+
1120
+ # source://sqlite3//lib/sqlite3/pragmas.rb#159
1121
+ def automatic_index; end
1122
+
1123
+ # source://sqlite3//lib/sqlite3/pragmas.rb#163
1124
+ def automatic_index=(mode); end
1125
+
1126
+ # source://sqlite3//lib/sqlite3/pragmas.rb#167
1127
+ def busy_timeout; end
1128
+
1129
+ # source://sqlite3//lib/sqlite3/pragmas.rb#171
1130
+ def busy_timeout=(milliseconds); end
1131
+
1132
+ # source://sqlite3//lib/sqlite3/pragmas.rb#175
1133
+ def cache_size; end
1134
+
1135
+ # source://sqlite3//lib/sqlite3/pragmas.rb#179
1136
+ def cache_size=(size); end
1137
+
1138
+ # source://sqlite3//lib/sqlite3/pragmas.rb#183
1139
+ def cache_spill; end
1140
+
1141
+ # source://sqlite3//lib/sqlite3/pragmas.rb#187
1142
+ def cache_spill=(mode); end
1143
+
1144
+ # source://sqlite3//lib/sqlite3/pragmas.rb#191
1145
+ def case_sensitive_like=(mode); end
1146
+
1147
+ # source://sqlite3//lib/sqlite3/pragmas.rb#195
1148
+ def cell_size_check; end
1149
+
1150
+ # source://sqlite3//lib/sqlite3/pragmas.rb#199
1151
+ def cell_size_check=(mode); end
1152
+
1153
+ # source://sqlite3//lib/sqlite3/pragmas.rb#203
1154
+ def checkpoint_fullfsync; end
1155
+
1156
+ # source://sqlite3//lib/sqlite3/pragmas.rb#207
1157
+ def checkpoint_fullfsync=(mode); end
1158
+
1159
+ # :yields: row
1160
+ #
1161
+ # source://sqlite3//lib/sqlite3/pragmas.rb#211
1162
+ def collation_list(&block); end
1163
+
1164
+ # :yields: row
1165
+ #
1166
+ # source://sqlite3//lib/sqlite3/pragmas.rb#215
1167
+ def compile_options(&block); end
1168
+
1169
+ # source://sqlite3//lib/sqlite3/pragmas.rb#219
1170
+ def count_changes; end
1171
+
1172
+ # source://sqlite3//lib/sqlite3/pragmas.rb#223
1173
+ def count_changes=(mode); end
1174
+
1175
+ # source://sqlite3//lib/sqlite3/pragmas.rb#227
1176
+ def data_version; end
1177
+
1178
+ # :yields: row
1179
+ #
1180
+ # source://sqlite3//lib/sqlite3/pragmas.rb#231
1181
+ def database_list(&block); end
1182
+
1183
+ # source://sqlite3//lib/sqlite3/pragmas.rb#235
1184
+ def default_cache_size; end
1185
+
1186
+ # source://sqlite3//lib/sqlite3/pragmas.rb#239
1187
+ def default_cache_size=(size); end
1188
+
1189
+ # source://sqlite3//lib/sqlite3/pragmas.rb#243
1190
+ def default_synchronous; end
1191
+
1192
+ # source://sqlite3//lib/sqlite3/pragmas.rb#247
1193
+ def default_synchronous=(mode); end
1194
+
1195
+ # source://sqlite3//lib/sqlite3/pragmas.rb#251
1196
+ def default_temp_store; end
1197
+
1198
+ # source://sqlite3//lib/sqlite3/pragmas.rb#255
1199
+ def default_temp_store=(mode); end
1200
+
1201
+ # source://sqlite3//lib/sqlite3/pragmas.rb#259
1202
+ def defer_foreign_keys; end
1203
+
1204
+ # source://sqlite3//lib/sqlite3/pragmas.rb#263
1205
+ def defer_foreign_keys=(mode); end
1206
+
1207
+ # source://sqlite3//lib/sqlite3/pragmas.rb#267
1208
+ def encoding; end
1209
+
1210
+ # source://sqlite3//lib/sqlite3/pragmas.rb#271
1211
+ def encoding=(mode); end
1212
+
1213
+ # :yields: row
1214
+ #
1215
+ # source://sqlite3//lib/sqlite3/pragmas.rb#275
1216
+ def foreign_key_check(*table, &block); end
1217
+
1218
+ # :yields: row
1219
+ #
1220
+ # source://sqlite3//lib/sqlite3/pragmas.rb#279
1221
+ def foreign_key_list(table, &block); end
1222
+
1223
+ # source://sqlite3//lib/sqlite3/pragmas.rb#283
1224
+ def foreign_keys; end
1225
+
1226
+ # source://sqlite3//lib/sqlite3/pragmas.rb#287
1227
+ def foreign_keys=(mode); end
1228
+
1229
+ # source://sqlite3//lib/sqlite3/pragmas.rb#291
1230
+ def freelist_count; end
1231
+
1232
+ # source://sqlite3//lib/sqlite3/pragmas.rb#295
1233
+ def full_column_names; end
1234
+
1235
+ # source://sqlite3//lib/sqlite3/pragmas.rb#299
1236
+ def full_column_names=(mode); end
1237
+
1238
+ # source://sqlite3//lib/sqlite3/pragmas.rb#303
1239
+ def fullfsync; end
1240
+
1241
+ # source://sqlite3//lib/sqlite3/pragmas.rb#307
1242
+ def fullfsync=(mode); end
1243
+
1244
+ # Returns +true+ or +false+ depending on the value of the named pragma.
1245
+ #
1246
+ # source://sqlite3//lib/sqlite3/pragmas.rb#13
1247
+ def get_boolean_pragma(name); end
1248
+
1249
+ # Return the value of the given pragma.
1250
+ #
1251
+ # source://sqlite3//lib/sqlite3/pragmas.rb#53
1252
+ def get_enum_pragma(name); end
1253
+
1254
+ # Returns the value of the given pragma as an integer.
1255
+ #
1256
+ # source://sqlite3//lib/sqlite3/pragmas.rb#80
1257
+ def get_int_pragma(name); end
1258
+
1259
+ # Requests the given pragma (and parameters), and if the block is given,
1260
+ # each row of the result set will be yielded to it. Otherwise, the results
1261
+ # are returned as an array.
1262
+ #
1263
+ # source://sqlite3//lib/sqlite3/pragmas.rb#43
1264
+ def get_query_pragma(name, *params, &block); end
1265
+
1266
+ # source://sqlite3//lib/sqlite3/pragmas.rb#311
1267
+ def ignore_check_constraints=(mode); end
1268
+
1269
+ # :yields: row
1270
+ #
1271
+ # source://sqlite3//lib/sqlite3/pragmas.rb#315
1272
+ def incremental_vacuum(pages, &block); end
1273
+
1274
+ # :yields: row
1275
+ #
1276
+ # source://sqlite3//lib/sqlite3/pragmas.rb#319
1277
+ def index_info(index, &block); end
1278
+
1279
+ # :yields: row
1280
+ #
1281
+ # source://sqlite3//lib/sqlite3/pragmas.rb#323
1282
+ def index_list(table, &block); end
1283
+
1284
+ # :yields: row
1285
+ #
1286
+ # source://sqlite3//lib/sqlite3/pragmas.rb#327
1287
+ def index_xinfo(index, &block); end
1288
+
1289
+ # :yields: row
1290
+ #
1291
+ # source://sqlite3//lib/sqlite3/pragmas.rb#331
1292
+ def integrity_check(*num_errors, &block); end
1293
+
1294
+ # source://sqlite3//lib/sqlite3/pragmas.rb#335
1295
+ def journal_mode; end
1296
+
1297
+ # source://sqlite3//lib/sqlite3/pragmas.rb#339
1298
+ def journal_mode=(mode); end
1299
+
1300
+ # source://sqlite3//lib/sqlite3/pragmas.rb#343
1301
+ def journal_size_limit; end
1302
+
1303
+ # source://sqlite3//lib/sqlite3/pragmas.rb#347
1304
+ def journal_size_limit=(size); end
1305
+
1306
+ # source://sqlite3//lib/sqlite3/pragmas.rb#351
1307
+ def legacy_file_format; end
1308
+
1309
+ # source://sqlite3//lib/sqlite3/pragmas.rb#355
1310
+ def legacy_file_format=(mode); end
1311
+
1312
+ # source://sqlite3//lib/sqlite3/pragmas.rb#359
1313
+ def locking_mode; end
1314
+
1315
+ # source://sqlite3//lib/sqlite3/pragmas.rb#363
1316
+ def locking_mode=(mode); end
1317
+
1318
+ # source://sqlite3//lib/sqlite3/pragmas.rb#367
1319
+ def max_page_count; end
1320
+
1321
+ # source://sqlite3//lib/sqlite3/pragmas.rb#371
1322
+ def max_page_count=(size); end
1323
+
1324
+ # source://sqlite3//lib/sqlite3/pragmas.rb#375
1325
+ def mmap_size; end
1326
+
1327
+ # source://sqlite3//lib/sqlite3/pragmas.rb#379
1328
+ def mmap_size=(size); end
1329
+
1330
+ # Attempt to optimize the database.
1331
+ #
1332
+ # To customize the optimization options, pass +bitmask+ with a combination
1333
+ # of the Constants::Optimize masks.
1334
+ #
1335
+ # See https://www.sqlite.org/pragma.html#pragma_optimize for more information.
1336
+ #
1337
+ # source://sqlite3//lib/sqlite3/pragmas.rb#389
1338
+ def optimize(bitmask = T.unsafe(nil)); end
1339
+
1340
+ # source://sqlite3//lib/sqlite3/pragmas.rb#397
1341
+ def page_count; end
1342
+
1343
+ # source://sqlite3//lib/sqlite3/pragmas.rb#401
1344
+ def page_size; end
1345
+
1346
+ # source://sqlite3//lib/sqlite3/pragmas.rb#405
1347
+ def page_size=(size); end
1348
+
1349
+ # source://sqlite3//lib/sqlite3/pragmas.rb#409
1350
+ def parser_trace=(mode); end
1351
+
1352
+ # source://sqlite3//lib/sqlite3/pragmas.rb#413
1353
+ def query_only; end
1354
+
1355
+ # source://sqlite3//lib/sqlite3/pragmas.rb#417
1356
+ def query_only=(mode); end
1357
+
1358
+ # :yields: row
1359
+ #
1360
+ # source://sqlite3//lib/sqlite3/pragmas.rb#421
1361
+ def quick_check(*num_errors, &block); end
1362
+
1363
+ # source://sqlite3//lib/sqlite3/pragmas.rb#425
1364
+ def read_uncommitted; end
1365
+
1366
+ # source://sqlite3//lib/sqlite3/pragmas.rb#429
1367
+ def read_uncommitted=(mode); end
1368
+
1369
+ # source://sqlite3//lib/sqlite3/pragmas.rb#433
1370
+ def recursive_triggers; end
1371
+
1372
+ # source://sqlite3//lib/sqlite3/pragmas.rb#437
1373
+ def recursive_triggers=(mode); end
1374
+
1375
+ # source://sqlite3//lib/sqlite3/pragmas.rb#441
1376
+ def reverse_unordered_selects; end
1377
+
1378
+ # source://sqlite3//lib/sqlite3/pragmas.rb#445
1379
+ def reverse_unordered_selects=(mode); end
1380
+
1381
+ # source://sqlite3//lib/sqlite3/pragmas.rb#449
1382
+ def schema_cookie; end
1383
+
1384
+ # source://sqlite3//lib/sqlite3/pragmas.rb#453
1385
+ def schema_cookie=(cookie); end
1386
+
1387
+ # source://sqlite3//lib/sqlite3/pragmas.rb#457
1388
+ def schema_version; end
1389
+
1390
+ # source://sqlite3//lib/sqlite3/pragmas.rb#461
1391
+ def schema_version=(version); end
1392
+
1393
+ # source://sqlite3//lib/sqlite3/pragmas.rb#465
1394
+ def secure_delete; end
1395
+
1396
+ # source://sqlite3//lib/sqlite3/pragmas.rb#469
1397
+ def secure_delete=(mode); end
1398
+
1399
+ # Sets the given pragma to the given boolean value. The value itself
1400
+ # may be +true+ or +false+, or any other commonly used string or
1401
+ # integer that represents truth.
1402
+ #
1403
+ # source://sqlite3//lib/sqlite3/pragmas.rb#20
1404
+ def set_boolean_pragma(name, mode); end
1405
+
1406
+ # Set the value of the given pragma to +mode+. The +mode+ parameter must
1407
+ # conform to one of the values in the given +enum+ array. Each entry in
1408
+ # the array is another array comprised of elements in the enumeration that
1409
+ # have duplicate values. See #synchronous, #default_synchronous,
1410
+ # #temp_store, and #default_temp_store for usage examples.
1411
+ #
1412
+ # source://sqlite3//lib/sqlite3/pragmas.rb#62
1413
+ def set_enum_pragma(name, mode, enums); end
1414
+
1415
+ # Set the value of the given pragma to the integer value of the +value+
1416
+ # parameter.
1417
+ #
1418
+ # source://sqlite3//lib/sqlite3/pragmas.rb#86
1419
+ def set_int_pragma(name, value); end
1420
+
1421
+ # source://sqlite3//lib/sqlite3/pragmas.rb#473
1422
+ def short_column_names; end
1423
+
1424
+ # source://sqlite3//lib/sqlite3/pragmas.rb#477
1425
+ def short_column_names=(mode); end
1426
+
1427
+ # source://sqlite3//lib/sqlite3/pragmas.rb#481
1428
+ def shrink_memory; end
1429
+
1430
+ # source://sqlite3//lib/sqlite3/pragmas.rb#485
1431
+ def soft_heap_limit; end
1432
+
1433
+ # source://sqlite3//lib/sqlite3/pragmas.rb#489
1434
+ def soft_heap_limit=(mode); end
1435
+
1436
+ # :yields: row
1437
+ #
1438
+ # source://sqlite3//lib/sqlite3/pragmas.rb#493
1439
+ def stats(&block); end
1440
+
1441
+ # source://sqlite3//lib/sqlite3/pragmas.rb#497
1442
+ def synchronous; end
1443
+
1444
+ # source://sqlite3//lib/sqlite3/pragmas.rb#501
1445
+ def synchronous=(mode); end
1446
+
1447
+ # Returns information about +table+. Yields each row of table information
1448
+ # if a block is provided.
1449
+ #
1450
+ # source://sqlite3//lib/sqlite3/pragmas.rb#580
1451
+ def table_info(table); end
1452
+
1453
+ # source://sqlite3//lib/sqlite3/pragmas.rb#505
1454
+ def temp_store; end
1455
+
1456
+ # source://sqlite3//lib/sqlite3/pragmas.rb#509
1457
+ def temp_store=(mode); end
1458
+
1459
+ # source://sqlite3//lib/sqlite3/pragmas.rb#513
1460
+ def threads; end
1461
+
1462
+ # source://sqlite3//lib/sqlite3/pragmas.rb#517
1463
+ def threads=(count); end
1464
+
1465
+ # source://sqlite3//lib/sqlite3/pragmas.rb#521
1466
+ def user_cookie; end
1467
+
1468
+ # source://sqlite3//lib/sqlite3/pragmas.rb#525
1469
+ def user_cookie=(cookie); end
1470
+
1471
+ # source://sqlite3//lib/sqlite3/pragmas.rb#529
1472
+ def user_version; end
1473
+
1474
+ # source://sqlite3//lib/sqlite3/pragmas.rb#533
1475
+ def user_version=(version); end
1476
+
1477
+ # source://sqlite3//lib/sqlite3/pragmas.rb#537
1478
+ def vdbe_addoptrace=(mode); end
1479
+
1480
+ # source://sqlite3//lib/sqlite3/pragmas.rb#541
1481
+ def vdbe_debug=(mode); end
1482
+
1483
+ # source://sqlite3//lib/sqlite3/pragmas.rb#545
1484
+ def vdbe_listing=(mode); end
1485
+
1486
+ # source://sqlite3//lib/sqlite3/pragmas.rb#549
1487
+ def vdbe_trace; end
1488
+
1489
+ # source://sqlite3//lib/sqlite3/pragmas.rb#553
1490
+ def vdbe_trace=(mode); end
1491
+
1492
+ # source://sqlite3//lib/sqlite3/pragmas.rb#557
1493
+ def wal_autocheckpoint; end
1494
+
1495
+ # source://sqlite3//lib/sqlite3/pragmas.rb#561
1496
+ def wal_autocheckpoint=(mode); end
1497
+
1498
+ # source://sqlite3//lib/sqlite3/pragmas.rb#565
1499
+ def wal_checkpoint; end
1500
+
1501
+ # source://sqlite3//lib/sqlite3/pragmas.rb#569
1502
+ def wal_checkpoint=(mode); end
1503
+
1504
+ # source://sqlite3//lib/sqlite3/pragmas.rb#573
1505
+ def writable_schema=(mode); end
1506
+
1507
+ private
1508
+
1509
+ # source://sqlite3//lib/sqlite3/pragmas.rb#613
1510
+ def set_string_pragma(pragma_name, value, valid_values); end
1511
+
1512
+ # Since SQLite 3.3.8, the table_info pragma has returned the default
1513
+ # value of the row as a quoted SQL value. This method essentially
1514
+ # unquotes those values.
1515
+ #
1516
+ # source://sqlite3//lib/sqlite3/pragmas.rb#637
1517
+ def tweak_default(hash); end
1518
+
1519
+ # Compares two version strings
1520
+ #
1521
+ # source://sqlite3//lib/sqlite3/pragmas.rb#621
1522
+ def version_compare(v1, v2); end
1523
+ end
1524
+
1525
+ # The enumeration of valid auto vacuum modes.
1526
+ #
1527
+ # source://sqlite3//lib/sqlite3/pragmas.rb#105
1528
+ SQLite3::Pragmas::AUTO_VACUUM_MODES = T.let(T.unsafe(nil), Hash)
1529
+
1530
+ # The list of valid encodings.
1531
+ #
1532
+ # source://sqlite3//lib/sqlite3/pragmas.rb#128
1533
+ SQLite3::Pragmas::ENCODINGS = T.let(T.unsafe(nil), Hash)
1534
+
1535
+ # The list of valid journaling modes.
1536
+ #
1537
+ # source://sqlite3//lib/sqlite3/pragmas.rb#112
1538
+ SQLite3::Pragmas::JOURNAL_MODES = T.let(T.unsafe(nil), Hash)
1539
+
1540
+ # The list of valid locking modes.
1541
+ #
1542
+ # source://sqlite3//lib/sqlite3/pragmas.rb#122
1543
+ SQLite3::Pragmas::LOCKING_MODES = T.let(T.unsafe(nil), Hash)
1544
+
1545
+ # The enumeration of valid synchronous modes.
1546
+ #
1547
+ # source://sqlite3//lib/sqlite3/pragmas.rb#91
1548
+ SQLite3::Pragmas::SYNCHRONOUS_MODES = T.let(T.unsafe(nil), Hash)
1549
+
1550
+ # The enumeration of valid temp store modes.
1551
+ #
1552
+ # source://sqlite3//lib/sqlite3/pragmas.rb#98
1553
+ SQLite3::Pragmas::TEMP_STORE_MODES = T.let(T.unsafe(nil), Hash)
1554
+
1555
+ # The list of valid WAL checkpoints.
1556
+ #
1557
+ # source://sqlite3//lib/sqlite3/pragmas.rb#136
1558
+ SQLite3::Pragmas::WAL_CHECKPOINTS = T.let(T.unsafe(nil), Hash)
1559
+
1560
+ # source://sqlite3//lib/sqlite3/errors.rb#65
1561
+ class SQLite3::ProtocolException < ::SQLite3::Exception; end
1562
+
1563
+ # source://sqlite3//lib/sqlite3/errors.rb#85
1564
+ class SQLite3::RangeException < ::SQLite3::Exception; end
1565
+
1566
+ # source://sqlite3//lib/sqlite3/errors.rb#51
1567
+ class SQLite3::ReadOnlyException < ::SQLite3::Exception; end
1568
+
1569
+ # The ResultSet object encapsulates the enumerability of a query's output.
1570
+ # It is a simple cursor over the data that the query returns. It will
1571
+ # very rarely (if ever) be instantiated directly. Instead, clients should
1572
+ # obtain a ResultSet instance via Statement#execute.
1573
+ #
1574
+ # source://sqlite3//lib/sqlite3/resultset.rb#9
1575
+ class SQLite3::ResultSet
1576
+ include ::Enumerable
1577
+
1578
+ # Create a new ResultSet attached to the given database, using the
1579
+ # given sql text.
1580
+ #
1581
+ # @return [ResultSet] a new instance of ResultSet
1582
+ #
1583
+ # source://sqlite3//lib/sqlite3/resultset.rb#14
1584
+ def initialize(db, stmt); end
1585
+
1586
+ # Closes the statement that spawned this result set.
1587
+ # <em>Use with caution!</em> Closing a result set will automatically
1588
+ # close any other result sets that were spawned from the same statement.
1589
+ #
1590
+ # source://sqlite3//lib/sqlite3/resultset.rb#65
1591
+ def close; end
1592
+
1593
+ # Queries whether the underlying statement has been closed or not.
1594
+ #
1595
+ # @return [Boolean]
1596
+ #
1597
+ # source://sqlite3//lib/sqlite3/resultset.rb#70
1598
+ def closed?; end
1599
+
1600
+ # Returns the names of the columns returned by this result set.
1601
+ #
1602
+ # source://sqlite3//lib/sqlite3/resultset.rb#80
1603
+ def columns; end
1604
+
1605
+ # Required by the Enumerable mixin. Provides an internal iterator over the
1606
+ # rows of the result set.
1607
+ #
1608
+ # source://sqlite3//lib/sqlite3/resultset.rb#48
1609
+ def each; end
1610
+
1611
+ # Provides an internal iterator over the rows of the result set where
1612
+ # each row is yielded as a hash.
1613
+ #
1614
+ # source://sqlite3//lib/sqlite3/resultset.rb#56
1615
+ def each_hash; end
1616
+
1617
+ # Query whether the cursor has reached the end of the result set or not.
1618
+ #
1619
+ # @return [Boolean]
1620
+ #
1621
+ # source://sqlite3//lib/sqlite3/resultset.rb#27
1622
+ def eof?; end
1623
+
1624
+ # Obtain the next row from the cursor. If there are no more rows to be
1625
+ # had, this will return +nil+.
1626
+ #
1627
+ # The returned value will be an array, unless Database#results_as_hash has
1628
+ # been set to +true+, in which case the returned value will be a hash.
1629
+ #
1630
+ # For arrays, the column names are accessible via the +fields+ property,
1631
+ # and the column types are accessible via the +types+ property.
1632
+ #
1633
+ # For hashes, the column names are the keys of the hash, and the column
1634
+ # types are accessible via the +types+ property.
1635
+ #
1636
+ # source://sqlite3//lib/sqlite3/resultset.rb#42
1637
+ def next; end
1638
+
1639
+ # Return the next row as a hash
1640
+ #
1641
+ # source://sqlite3//lib/sqlite3/resultset.rb#85
1642
+ def next_hash; end
1643
+
1644
+ # Reset the cursor, so that a result set which has reached end-of-file
1645
+ # can be rewound and reiterated.
1646
+ #
1647
+ # source://sqlite3//lib/sqlite3/resultset.rb#21
1648
+ def reset(*bind_params); end
1649
+
1650
+ # Returns the types of the columns returned by this result set.
1651
+ #
1652
+ # source://sqlite3//lib/sqlite3/resultset.rb#75
1653
+ def types; end
1654
+ end
1655
+
1656
+ # source://sqlite3//lib/sqlite3/errors.rb#37
1657
+ class SQLite3::SQLException < ::SQLite3::Exception; end
1658
+
1659
+ SQLite3::SQLITE_LOADED_VERSION = T.let(T.unsafe(nil), String)
1660
+ SQLite3::SQLITE_PACKAGED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
1661
+ SQLite3::SQLITE_PRECOMPILED_LIBRARIES = T.let(T.unsafe(nil), TrueClass)
1662
+ SQLite3::SQLITE_VERSION = T.let(T.unsafe(nil), String)
1663
+ SQLite3::SQLITE_VERSION_NUMBER = T.let(T.unsafe(nil), Integer)
1664
+
1665
+ # source://sqlite3//lib/sqlite3/errors.rb#69
1666
+ class SQLite3::SchemaChangedException < ::SQLite3::Exception; end
1667
+
1668
+ # A statement represents a prepared-but-unexecuted SQL query. It will rarely
1669
+ # (if ever) be instantiated directly by a client, and is most often obtained
1670
+ # via the Database#prepare method.
1671
+ #
1672
+ # source://sqlite3//lib/sqlite3/statement.rb#14
1673
+ class SQLite3::Statement
1674
+ include ::Enumerable
1675
+
1676
+ # call-seq: SQLite3::Statement.new(db, sql)
1677
+ #
1678
+ # Create a new statement attached to the given Database instance, and which
1679
+ # encapsulates the given SQL text. If the text contains more than one
1680
+ # statement (i.e., separated by semicolons), then the #remainder property
1681
+ # will be set to the trailing text.
1682
+ #
1683
+ # @raise [ArgumentError]
1684
+ # @return [Statement] a new instance of Statement
1685
+ #
1686
+ # source://sqlite3//lib/sqlite3/statement.rb#28
1687
+ def initialize(db, sql); end
1688
+
1689
+ # Returns true if the statement is currently active, meaning it has an
1690
+ # open result set.
1691
+ #
1692
+ # @return [Boolean]
1693
+ #
1694
+ # source://sqlite3//lib/sqlite3/statement.rb#111
1695
+ def active?; end
1696
+
1697
+ def bind_param(_arg0, _arg1); end
1698
+ def bind_parameter_count; end
1699
+
1700
+ # Binds the given variables to the corresponding placeholders in the SQL
1701
+ # text.
1702
+ #
1703
+ # See Database#execute for a description of the valid placeholder
1704
+ # syntaxes.
1705
+ #
1706
+ # Example:
1707
+ #
1708
+ # stmt = db.prepare( "select * from table where a=? and b=?" )
1709
+ # stmt.bind_params( 15, "hello" )
1710
+ #
1711
+ # See also #execute, #bind_param, Statement#bind_param, and
1712
+ # Statement#bind_params.
1713
+ #
1714
+ # source://sqlite3//lib/sqlite3/statement.rb#52
1715
+ def bind_params(*bind_vars); end
1716
+
1717
+ def clear_bindings!; end
1718
+ def close; end
1719
+ def closed?; end
1720
+ def column_count; end
1721
+ def column_decltype(_arg0); end
1722
+ def column_name(_arg0); end
1723
+
1724
+ # Return an array of the column names for this statement. Note that this
1725
+ # may execute the statement in order to obtain the metadata; this makes it
1726
+ # a (potentially) expensive operation.
1727
+ #
1728
+ # source://sqlite3//lib/sqlite3/statement.rb#118
1729
+ def columns; end
1730
+
1731
+ def done?; end
1732
+
1733
+ # source://sqlite3//lib/sqlite3/statement.rb#123
1734
+ def each; end
1735
+
1736
+ # Execute the statement. This creates a new ResultSet object for the
1737
+ # statement's virtual machine. If a block was given, the new ResultSet will
1738
+ # be yielded to it; otherwise, the ResultSet will be returned.
1739
+ #
1740
+ # Any parameters will be bound to the statement using #bind_params.
1741
+ #
1742
+ # Example:
1743
+ #
1744
+ # stmt = db.prepare( "select * from table" )
1745
+ # stmt.execute do |result|
1746
+ # ...
1747
+ # end
1748
+ #
1749
+ # See also #bind_params, #execute!.
1750
+ #
1751
+ # @yield [results]
1752
+ #
1753
+ # source://sqlite3//lib/sqlite3/statement.rb#78
1754
+ def execute(*bind_vars); end
1755
+
1756
+ # Execute the statement. If no block was given, this returns an array of
1757
+ # rows returned by executing the statement. Otherwise, each row will be
1758
+ # yielded to the block.
1759
+ #
1760
+ # Any parameters will be bound to the statement using #bind_params.
1761
+ #
1762
+ # Example:
1763
+ #
1764
+ # stmt = db.prepare( "select * from table" )
1765
+ # stmt.execute! do |row|
1766
+ # ...
1767
+ # end
1768
+ #
1769
+ # See also #bind_params, #execute.
1770
+ #
1771
+ # source://sqlite3//lib/sqlite3/statement.rb#104
1772
+ def execute!(*bind_vars, &block); end
1773
+
1774
+ def expanded_sql; end
1775
+ def memused; end
1776
+
1777
+ # Performs a sanity check to ensure that the statement is not
1778
+ # closed. If it is, an exception is raised.
1779
+ #
1780
+ # source://sqlite3//lib/sqlite3/statement.rb#142
1781
+ def must_be_open!; end
1782
+
1783
+ # This is any text that followed the first valid SQL statement in the text
1784
+ # with which the statement was initialized. If there was no trailing text,
1785
+ # this will be the empty string.
1786
+ #
1787
+ # source://sqlite3//lib/sqlite3/statement.rb#20
1788
+ def remainder; end
1789
+
1790
+ def reset!; end
1791
+ def sql; end
1792
+
1793
+ # Returns a Hash containing information about the statement.
1794
+ # The contents of the hash are implementation specific and may change in
1795
+ # the future without notice. The hash includes information about internal
1796
+ # statistics about the statement such as:
1797
+ # - +fullscan_steps+: the number of times that SQLite has stepped forward
1798
+ # in a table as part of a full table scan
1799
+ # - +sorts+: the number of sort operations that have occurred
1800
+ # - +autoindexes+: the number of rows inserted into transient indices
1801
+ # that were created automatically in order to help joins run faster
1802
+ # - +vm_steps+: the number of virtual machine operations executed by the
1803
+ # prepared statement
1804
+ # - +reprepares+: the number of times that the prepare statement has been
1805
+ # automatically regenerated due to schema changes or changes to bound
1806
+ # parameters that might affect the query plan
1807
+ # - +runs+: the number of times that the prepared statement has been run
1808
+ # - +filter_misses+: the number of times that the Bloom filter returned
1809
+ # a find, and thus the join step had to be processed as normal
1810
+ # - +filter_hits+: the number of times that a join step was bypassed
1811
+ # because a Bloom filter returned not-found
1812
+ #
1813
+ # source://sqlite3//lib/sqlite3/statement.rb#167
1814
+ def stat(key = T.unsafe(nil)); end
1815
+
1816
+ def step; end
1817
+
1818
+ # Return an array of the data types for each column in this statement. Note
1819
+ # that this may execute the statement in order to obtain the metadata; this
1820
+ # makes it a (potentially) expensive operation.
1821
+ #
1822
+ # source://sqlite3//lib/sqlite3/statement.rb#134
1823
+ def types; end
1824
+
1825
+ private
1826
+
1827
+ # A convenience method for obtaining the metadata about the query. Note
1828
+ # that this will actually execute the SQL, which means it can be a
1829
+ # (potentially) expensive operation.
1830
+ #
1831
+ # source://sqlite3//lib/sqlite3/statement.rb#180
1832
+ def get_metadata; end
1833
+
1834
+ def prepare(_arg0, _arg1); end
1835
+ def stat_for(_arg0); end
1836
+ def stats_as_hash; end
1837
+ end
1838
+
1839
+ # source://sqlite3//lib/sqlite3/errors.rb#71
1840
+ class SQLite3::TooBigException < ::SQLite3::Exception; end
1841
+
1842
+ # source://sqlite3//lib/sqlite3/errors.rb#79
1843
+ class SQLite3::UnsupportedException < ::SQLite3::Exception; end
1844
+
1845
+ # (String) the version of the sqlite3 gem, e.g. "2.1.1"
1846
+ #
1847
+ # source://sqlite3//lib/sqlite3/version.rb#3
1848
+ SQLite3::VERSION = T.let(T.unsafe(nil), String)
1849
+
1850
+ # a hash of descriptive metadata about the current version of the sqlite3 gem
1851
+ #
1852
+ # source://sqlite3//lib/sqlite3/version_info.rb#3
1853
+ SQLite3::VERSION_INFO = T.let(T.unsafe(nil), Hash)
1854
+
1855
+ # source://sqlite3//lib/sqlite3/value.rb#4
1856
+ class SQLite3::Value
1857
+ # @return [Value] a new instance of Value
1858
+ #
1859
+ # source://sqlite3//lib/sqlite3/value.rb#7
1860
+ def initialize(db, handle); end
1861
+
1862
+ # Returns the value of attribute handle.
1863
+ #
1864
+ # source://sqlite3//lib/sqlite3/value.rb#5
1865
+ def handle; end
1866
+
1867
+ # source://sqlite3//lib/sqlite3/value.rb#20
1868
+ def length(utf16 = T.unsafe(nil)); end
1869
+
1870
+ # @return [Boolean]
1871
+ #
1872
+ # source://sqlite3//lib/sqlite3/value.rb#12
1873
+ def null?; end
1874
+
1875
+ # source://sqlite3//lib/sqlite3/value.rb#16
1876
+ def to_blob; end
1877
+
1878
+ # source://sqlite3//lib/sqlite3/value.rb#28
1879
+ def to_f; end
1880
+
1881
+ # source://sqlite3//lib/sqlite3/value.rb#32
1882
+ def to_i; end
1883
+
1884
+ # source://sqlite3//lib/sqlite3/value.rb#36
1885
+ def to_int64; end
1886
+
1887
+ # source://sqlite3//lib/sqlite3/value.rb#40
1888
+ def to_s(utf16 = T.unsafe(nil)); end
1889
+
1890
+ # source://sqlite3//lib/sqlite3/value.rb#44
1891
+ def type; end
1892
+ end
1893
+
1894
+ # source://sqlite3//lib/sqlite3/statement.rb#4
1895
+ class String
1896
+ include ::Comparable
1897
+
1898
+ # source://sqlite3//lib/sqlite3/statement.rb#5
1899
+ def to_blob; end
1900
+ end