Loggest thy stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

628 lines
28 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. // Code generated by sqlc. DO NOT EDIT.
  2. // versions:
  3. // sqlc v1.13.0
  4. package mysqlcore
  5. import (
  6. "context"
  7. "database/sql"
  8. "fmt"
  9. )
  10. type DBTX interface {
  11. ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
  12. PrepareContext(context.Context, string) (*sql.Stmt, error)
  13. QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
  14. QueryRowContext(context.Context, string, ...interface{}) *sql.Row
  15. }
  16. func New(db DBTX) *Queries {
  17. return &Queries{db: db}
  18. }
  19. func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
  20. q := Queries{db: db}
  21. var err error
  22. if q.cLearItemStatProgressByStatStmt, err = db.PrepareContext(ctx, cLearItemStatProgressByStat); err != nil {
  23. return nil, fmt.Errorf("error preparing query CLearItemStatProgressByStat: %w", err)
  24. }
  25. if q.clearItemProjectRequirementStmt, err = db.PrepareContext(ctx, clearItemProjectRequirement); err != nil {
  26. return nil, fmt.Errorf("error preparing query ClearItemProjectRequirement: %w", err)
  27. }
  28. if q.clearItemProjectRequirementByProjectIDStmt, err = db.PrepareContext(ctx, clearItemProjectRequirementByProjectID); err != nil {
  29. return nil, fmt.Errorf("error preparing query ClearItemProjectRequirementByProjectID: %w", err)
  30. }
  31. if q.clearItemStatProgressStmt, err = db.PrepareContext(ctx, clearItemStatProgress); err != nil {
  32. return nil, fmt.Errorf("error preparing query ClearItemStatProgress: %w", err)
  33. }
  34. if q.deleteAllProjectRequirementStatsStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirementStats); err != nil {
  35. return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirementStats: %w", err)
  36. }
  37. if q.deleteAllProjectRequirementStatsByStatStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirementStatsByStat); err != nil {
  38. return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirementStatsByStat: %w", err)
  39. }
  40. if q.deleteAllProjectRequirementsStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirements); err != nil {
  41. return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirements: %w", err)
  42. }
  43. if q.deleteAllScopeMembersStmt, err = db.PrepareContext(ctx, deleteAllScopeMembers); err != nil {
  44. return nil, fmt.Errorf("error preparing query DeleteAllScopeMembers: %w", err)
  45. }
  46. if q.deleteItemStmt, err = db.PrepareContext(ctx, deleteItem); err != nil {
  47. return nil, fmt.Errorf("error preparing query DeleteItem: %w", err)
  48. }
  49. if q.deleteItemForRequirementStmt, err = db.PrepareContext(ctx, deleteItemForRequirement); err != nil {
  50. return nil, fmt.Errorf("error preparing query DeleteItemForRequirement: %w", err)
  51. }
  52. if q.deleteItemStatProgressStmt, err = db.PrepareContext(ctx, deleteItemStatProgress); err != nil {
  53. return nil, fmt.Errorf("error preparing query DeleteItemStatProgress: %w", err)
  54. }
  55. if q.deleteProjectStmt, err = db.PrepareContext(ctx, deleteProject); err != nil {
  56. return nil, fmt.Errorf("error preparing query DeleteProject: %w", err)
  57. }
  58. if q.deleteProjectRequirementStmt, err = db.PrepareContext(ctx, deleteProjectRequirement); err != nil {
  59. return nil, fmt.Errorf("error preparing query DeleteProjectRequirement: %w", err)
  60. }
  61. if q.deleteProjectRequirementStatStmt, err = db.PrepareContext(ctx, deleteProjectRequirementStat); err != nil {
  62. return nil, fmt.Errorf("error preparing query DeleteProjectRequirementStat: %w", err)
  63. }
  64. if q.deleteScopeStmt, err = db.PrepareContext(ctx, deleteScope); err != nil {
  65. return nil, fmt.Errorf("error preparing query DeleteScope: %w", err)
  66. }
  67. if q.deleteScopeMemberStmt, err = db.PrepareContext(ctx, deleteScopeMember); err != nil {
  68. return nil, fmt.Errorf("error preparing query DeleteScopeMember: %w", err)
  69. }
  70. if q.deleteStatStmt, err = db.PrepareContext(ctx, deleteStat); err != nil {
  71. return nil, fmt.Errorf("error preparing query DeleteStat: %w", err)
  72. }
  73. if q.getItemStmt, err = db.PrepareContext(ctx, getItem); err != nil {
  74. return nil, fmt.Errorf("error preparing query GetItem: %w", err)
  75. }
  76. if q.getItemStatProgressBetweenStmt, err = db.PrepareContext(ctx, getItemStatProgressBetween); err != nil {
  77. return nil, fmt.Errorf("error preparing query GetItemStatProgressBetween: %w", err)
  78. }
  79. if q.getProjectStmt, err = db.PrepareContext(ctx, getProject); err != nil {
  80. return nil, fmt.Errorf("error preparing query GetProject: %w", err)
  81. }
  82. if q.getProjectRequirementStmt, err = db.PrepareContext(ctx, getProjectRequirement); err != nil {
  83. return nil, fmt.Errorf("error preparing query GetProjectRequirement: %w", err)
  84. }
  85. if q.getScopeStmt, err = db.PrepareContext(ctx, getScope); err != nil {
  86. return nil, fmt.Errorf("error preparing query GetScope: %w", err)
  87. }
  88. if q.getScopeDisplayNameStmt, err = db.PrepareContext(ctx, getScopeDisplayName); err != nil {
  89. return nil, fmt.Errorf("error preparing query GetScopeDisplayName: %w", err)
  90. }
  91. if q.getScopeWithDisplayNameStmt, err = db.PrepareContext(ctx, getScopeWithDisplayName); err != nil {
  92. return nil, fmt.Errorf("error preparing query GetScopeWithDisplayName: %w", err)
  93. }
  94. if q.getStatStmt, err = db.PrepareContext(ctx, getStat); err != nil {
  95. return nil, fmt.Errorf("error preparing query GetStat: %w", err)
  96. }
  97. if q.insertItemStmt, err = db.PrepareContext(ctx, insertItem); err != nil {
  98. return nil, fmt.Errorf("error preparing query InsertItem: %w", err)
  99. }
  100. if q.insertProjectStmt, err = db.PrepareContext(ctx, insertProject); err != nil {
  101. return nil, fmt.Errorf("error preparing query InsertProject: %w", err)
  102. }
  103. if q.insertProjectRequirementStmt, err = db.PrepareContext(ctx, insertProjectRequirement); err != nil {
  104. return nil, fmt.Errorf("error preparing query InsertProjectRequirement: %w", err)
  105. }
  106. if q.insertScopeStmt, err = db.PrepareContext(ctx, insertScope); err != nil {
  107. return nil, fmt.Errorf("error preparing query InsertScope: %w", err)
  108. }
  109. if q.insertStatStmt, err = db.PrepareContext(ctx, insertStat); err != nil {
  110. return nil, fmt.Errorf("error preparing query InsertStat: %w", err)
  111. }
  112. if q.listItemStatProgressStmt, err = db.PrepareContext(ctx, listItemStatProgress); err != nil {
  113. return nil, fmt.Errorf("error preparing query ListItemStatProgress: %w", err)
  114. }
  115. if q.listItemStatProgressMultiStmt, err = db.PrepareContext(ctx, listItemStatProgressMulti); err != nil {
  116. return nil, fmt.Errorf("error preparing query ListItemStatProgressMulti: %w", err)
  117. }
  118. if q.listItemsAcquiredBetweenStmt, err = db.PrepareContext(ctx, listItemsAcquiredBetween); err != nil {
  119. return nil, fmt.Errorf("error preparing query ListItemsAcquiredBetween: %w", err)
  120. }
  121. if q.listItemsByProjectStmt, err = db.PrepareContext(ctx, listItemsByProject); err != nil {
  122. return nil, fmt.Errorf("error preparing query ListItemsByProject: %w", err)
  123. }
  124. if q.listItemsCreatedBetweenStmt, err = db.PrepareContext(ctx, listItemsCreatedBetween); err != nil {
  125. return nil, fmt.Errorf("error preparing query ListItemsCreatedBetween: %w", err)
  126. }
  127. if q.listItemsCreatedBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsCreatedBetweenNoScope); err != nil {
  128. return nil, fmt.Errorf("error preparing query ListItemsCreatedBetweenNoScope: %w", err)
  129. }
  130. if q.listItemsLooseBetweenStmt, err = db.PrepareContext(ctx, listItemsLooseBetween); err != nil {
  131. return nil, fmt.Errorf("error preparing query ListItemsLooseBetween: %w", err)
  132. }
  133. if q.listItemsLooseBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsLooseBetweenNoScope); err != nil {
  134. return nil, fmt.Errorf("error preparing query ListItemsLooseBetweenNoScope: %w", err)
  135. }
  136. if q.listItemsScheduledBetweenStmt, err = db.PrepareContext(ctx, listItemsScheduledBetween); err != nil {
  137. return nil, fmt.Errorf("error preparing query ListItemsScheduledBetween: %w", err)
  138. }
  139. if q.listItemsScheduledBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsScheduledBetweenNoScope); err != nil {
  140. return nil, fmt.Errorf("error preparing query ListItemsScheduledBetweenNoScope: %w", err)
  141. }
  142. if q.listProjectEntriesStmt, err = db.PrepareContext(ctx, listProjectEntries); err != nil {
  143. return nil, fmt.Errorf("error preparing query ListProjectEntries: %w", err)
  144. }
  145. if q.listProjectRequirementStatsStmt, err = db.PrepareContext(ctx, listProjectRequirementStats); err != nil {
  146. return nil, fmt.Errorf("error preparing query ListProjectRequirementStats: %w", err)
  147. }
  148. if q.listProjectRequirementsByProjectIDStmt, err = db.PrepareContext(ctx, listProjectRequirementsByProjectID); err != nil {
  149. return nil, fmt.Errorf("error preparing query ListProjectRequirementsByProjectID: %w", err)
  150. }
  151. if q.listScopeMembersStmt, err = db.PrepareContext(ctx, listScopeMembers); err != nil {
  152. return nil, fmt.Errorf("error preparing query ListScopeMembers: %w", err)
  153. }
  154. if q.listScopesStmt, err = db.PrepareContext(ctx, listScopes); err != nil {
  155. return nil, fmt.Errorf("error preparing query ListScopes: %w", err)
  156. }
  157. if q.listScopesByUserStmt, err = db.PrepareContext(ctx, listScopesByUser); err != nil {
  158. return nil, fmt.Errorf("error preparing query ListScopesByUser: %w", err)
  159. }
  160. if q.listStatsStmt, err = db.PrepareContext(ctx, listStats); err != nil {
  161. return nil, fmt.Errorf("error preparing query ListStats: %w", err)
  162. }
  163. if q.replaceItemStatProgressStmt, err = db.PrepareContext(ctx, replaceItemStatProgress); err != nil {
  164. return nil, fmt.Errorf("error preparing query ReplaceItemStatProgress: %w", err)
  165. }
  166. if q.replaceProjectRequirementStatStmt, err = db.PrepareContext(ctx, replaceProjectRequirementStat); err != nil {
  167. return nil, fmt.Errorf("error preparing query ReplaceProjectRequirementStat: %w", err)
  168. }
  169. if q.updateItemStmt, err = db.PrepareContext(ctx, updateItem); err != nil {
  170. return nil, fmt.Errorf("error preparing query UpdateItem: %w", err)
  171. }
  172. if q.updateProjectStmt, err = db.PrepareContext(ctx, updateProject); err != nil {
  173. return nil, fmt.Errorf("error preparing query UpdateProject: %w", err)
  174. }
  175. if q.updateProjectRequirementStmt, err = db.PrepareContext(ctx, updateProjectRequirement); err != nil {
  176. return nil, fmt.Errorf("error preparing query UpdateProjectRequirement: %w", err)
  177. }
  178. if q.updateScopeStmt, err = db.PrepareContext(ctx, updateScope); err != nil {
  179. return nil, fmt.Errorf("error preparing query UpdateScope: %w", err)
  180. }
  181. if q.updateScopeMemberStmt, err = db.PrepareContext(ctx, updateScopeMember); err != nil {
  182. return nil, fmt.Errorf("error preparing query UpdateScopeMember: %w", err)
  183. }
  184. if q.updateStatStmt, err = db.PrepareContext(ctx, updateStat); err != nil {
  185. return nil, fmt.Errorf("error preparing query UpdateStat: %w", err)
  186. }
  187. return &q, nil
  188. }
  189. func (q *Queries) Close() error {
  190. var err error
  191. if q.cLearItemStatProgressByStatStmt != nil {
  192. if cerr := q.cLearItemStatProgressByStatStmt.Close(); cerr != nil {
  193. err = fmt.Errorf("error closing cLearItemStatProgressByStatStmt: %w", cerr)
  194. }
  195. }
  196. if q.clearItemProjectRequirementStmt != nil {
  197. if cerr := q.clearItemProjectRequirementStmt.Close(); cerr != nil {
  198. err = fmt.Errorf("error closing clearItemProjectRequirementStmt: %w", cerr)
  199. }
  200. }
  201. if q.clearItemProjectRequirementByProjectIDStmt != nil {
  202. if cerr := q.clearItemProjectRequirementByProjectIDStmt.Close(); cerr != nil {
  203. err = fmt.Errorf("error closing clearItemProjectRequirementByProjectIDStmt: %w", cerr)
  204. }
  205. }
  206. if q.clearItemStatProgressStmt != nil {
  207. if cerr := q.clearItemStatProgressStmt.Close(); cerr != nil {
  208. err = fmt.Errorf("error closing clearItemStatProgressStmt: %w", cerr)
  209. }
  210. }
  211. if q.deleteAllProjectRequirementStatsStmt != nil {
  212. if cerr := q.deleteAllProjectRequirementStatsStmt.Close(); cerr != nil {
  213. err = fmt.Errorf("error closing deleteAllProjectRequirementStatsStmt: %w", cerr)
  214. }
  215. }
  216. if q.deleteAllProjectRequirementStatsByStatStmt != nil {
  217. if cerr := q.deleteAllProjectRequirementStatsByStatStmt.Close(); cerr != nil {
  218. err = fmt.Errorf("error closing deleteAllProjectRequirementStatsByStatStmt: %w", cerr)
  219. }
  220. }
  221. if q.deleteAllProjectRequirementsStmt != nil {
  222. if cerr := q.deleteAllProjectRequirementsStmt.Close(); cerr != nil {
  223. err = fmt.Errorf("error closing deleteAllProjectRequirementsStmt: %w", cerr)
  224. }
  225. }
  226. if q.deleteAllScopeMembersStmt != nil {
  227. if cerr := q.deleteAllScopeMembersStmt.Close(); cerr != nil {
  228. err = fmt.Errorf("error closing deleteAllScopeMembersStmt: %w", cerr)
  229. }
  230. }
  231. if q.deleteItemStmt != nil {
  232. if cerr := q.deleteItemStmt.Close(); cerr != nil {
  233. err = fmt.Errorf("error closing deleteItemStmt: %w", cerr)
  234. }
  235. }
  236. if q.deleteItemForRequirementStmt != nil {
  237. if cerr := q.deleteItemForRequirementStmt.Close(); cerr != nil {
  238. err = fmt.Errorf("error closing deleteItemForRequirementStmt: %w", cerr)
  239. }
  240. }
  241. if q.deleteItemStatProgressStmt != nil {
  242. if cerr := q.deleteItemStatProgressStmt.Close(); cerr != nil {
  243. err = fmt.Errorf("error closing deleteItemStatProgressStmt: %w", cerr)
  244. }
  245. }
  246. if q.deleteProjectStmt != nil {
  247. if cerr := q.deleteProjectStmt.Close(); cerr != nil {
  248. err = fmt.Errorf("error closing deleteProjectStmt: %w", cerr)
  249. }
  250. }
  251. if q.deleteProjectRequirementStmt != nil {
  252. if cerr := q.deleteProjectRequirementStmt.Close(); cerr != nil {
  253. err = fmt.Errorf("error closing deleteProjectRequirementStmt: %w", cerr)
  254. }
  255. }
  256. if q.deleteProjectRequirementStatStmt != nil {
  257. if cerr := q.deleteProjectRequirementStatStmt.Close(); cerr != nil {
  258. err = fmt.Errorf("error closing deleteProjectRequirementStatStmt: %w", cerr)
  259. }
  260. }
  261. if q.deleteScopeStmt != nil {
  262. if cerr := q.deleteScopeStmt.Close(); cerr != nil {
  263. err = fmt.Errorf("error closing deleteScopeStmt: %w", cerr)
  264. }
  265. }
  266. if q.deleteScopeMemberStmt != nil {
  267. if cerr := q.deleteScopeMemberStmt.Close(); cerr != nil {
  268. err = fmt.Errorf("error closing deleteScopeMemberStmt: %w", cerr)
  269. }
  270. }
  271. if q.deleteStatStmt != nil {
  272. if cerr := q.deleteStatStmt.Close(); cerr != nil {
  273. err = fmt.Errorf("error closing deleteStatStmt: %w", cerr)
  274. }
  275. }
  276. if q.getItemStmt != nil {
  277. if cerr := q.getItemStmt.Close(); cerr != nil {
  278. err = fmt.Errorf("error closing getItemStmt: %w", cerr)
  279. }
  280. }
  281. if q.getItemStatProgressBetweenStmt != nil {
  282. if cerr := q.getItemStatProgressBetweenStmt.Close(); cerr != nil {
  283. err = fmt.Errorf("error closing getItemStatProgressBetweenStmt: %w", cerr)
  284. }
  285. }
  286. if q.getProjectStmt != nil {
  287. if cerr := q.getProjectStmt.Close(); cerr != nil {
  288. err = fmt.Errorf("error closing getProjectStmt: %w", cerr)
  289. }
  290. }
  291. if q.getProjectRequirementStmt != nil {
  292. if cerr := q.getProjectRequirementStmt.Close(); cerr != nil {
  293. err = fmt.Errorf("error closing getProjectRequirementStmt: %w", cerr)
  294. }
  295. }
  296. if q.getScopeStmt != nil {
  297. if cerr := q.getScopeStmt.Close(); cerr != nil {
  298. err = fmt.Errorf("error closing getScopeStmt: %w", cerr)
  299. }
  300. }
  301. if q.getScopeDisplayNameStmt != nil {
  302. if cerr := q.getScopeDisplayNameStmt.Close(); cerr != nil {
  303. err = fmt.Errorf("error closing getScopeDisplayNameStmt: %w", cerr)
  304. }
  305. }
  306. if q.getScopeWithDisplayNameStmt != nil {
  307. if cerr := q.getScopeWithDisplayNameStmt.Close(); cerr != nil {
  308. err = fmt.Errorf("error closing getScopeWithDisplayNameStmt: %w", cerr)
  309. }
  310. }
  311. if q.getStatStmt != nil {
  312. if cerr := q.getStatStmt.Close(); cerr != nil {
  313. err = fmt.Errorf("error closing getStatStmt: %w", cerr)
  314. }
  315. }
  316. if q.insertItemStmt != nil {
  317. if cerr := q.insertItemStmt.Close(); cerr != nil {
  318. err = fmt.Errorf("error closing insertItemStmt: %w", cerr)
  319. }
  320. }
  321. if q.insertProjectStmt != nil {
  322. if cerr := q.insertProjectStmt.Close(); cerr != nil {
  323. err = fmt.Errorf("error closing insertProjectStmt: %w", cerr)
  324. }
  325. }
  326. if q.insertProjectRequirementStmt != nil {
  327. if cerr := q.insertProjectRequirementStmt.Close(); cerr != nil {
  328. err = fmt.Errorf("error closing insertProjectRequirementStmt: %w", cerr)
  329. }
  330. }
  331. if q.insertScopeStmt != nil {
  332. if cerr := q.insertScopeStmt.Close(); cerr != nil {
  333. err = fmt.Errorf("error closing insertScopeStmt: %w", cerr)
  334. }
  335. }
  336. if q.insertStatStmt != nil {
  337. if cerr := q.insertStatStmt.Close(); cerr != nil {
  338. err = fmt.Errorf("error closing insertStatStmt: %w", cerr)
  339. }
  340. }
  341. if q.listItemStatProgressStmt != nil {
  342. if cerr := q.listItemStatProgressStmt.Close(); cerr != nil {
  343. err = fmt.Errorf("error closing listItemStatProgressStmt: %w", cerr)
  344. }
  345. }
  346. if q.listItemStatProgressMultiStmt != nil {
  347. if cerr := q.listItemStatProgressMultiStmt.Close(); cerr != nil {
  348. err = fmt.Errorf("error closing listItemStatProgressMultiStmt: %w", cerr)
  349. }
  350. }
  351. if q.listItemsAcquiredBetweenStmt != nil {
  352. if cerr := q.listItemsAcquiredBetweenStmt.Close(); cerr != nil {
  353. err = fmt.Errorf("error closing listItemsAcquiredBetweenStmt: %w", cerr)
  354. }
  355. }
  356. if q.listItemsByProjectStmt != nil {
  357. if cerr := q.listItemsByProjectStmt.Close(); cerr != nil {
  358. err = fmt.Errorf("error closing listItemsByProjectStmt: %w", cerr)
  359. }
  360. }
  361. if q.listItemsCreatedBetweenStmt != nil {
  362. if cerr := q.listItemsCreatedBetweenStmt.Close(); cerr != nil {
  363. err = fmt.Errorf("error closing listItemsCreatedBetweenStmt: %w", cerr)
  364. }
  365. }
  366. if q.listItemsCreatedBetweenNoScopeStmt != nil {
  367. if cerr := q.listItemsCreatedBetweenNoScopeStmt.Close(); cerr != nil {
  368. err = fmt.Errorf("error closing listItemsCreatedBetweenNoScopeStmt: %w", cerr)
  369. }
  370. }
  371. if q.listItemsLooseBetweenStmt != nil {
  372. if cerr := q.listItemsLooseBetweenStmt.Close(); cerr != nil {
  373. err = fmt.Errorf("error closing listItemsLooseBetweenStmt: %w", cerr)
  374. }
  375. }
  376. if q.listItemsLooseBetweenNoScopeStmt != nil {
  377. if cerr := q.listItemsLooseBetweenNoScopeStmt.Close(); cerr != nil {
  378. err = fmt.Errorf("error closing listItemsLooseBetweenNoScopeStmt: %w", cerr)
  379. }
  380. }
  381. if q.listItemsScheduledBetweenStmt != nil {
  382. if cerr := q.listItemsScheduledBetweenStmt.Close(); cerr != nil {
  383. err = fmt.Errorf("error closing listItemsScheduledBetweenStmt: %w", cerr)
  384. }
  385. }
  386. if q.listItemsScheduledBetweenNoScopeStmt != nil {
  387. if cerr := q.listItemsScheduledBetweenNoScopeStmt.Close(); cerr != nil {
  388. err = fmt.Errorf("error closing listItemsScheduledBetweenNoScopeStmt: %w", cerr)
  389. }
  390. }
  391. if q.listProjectEntriesStmt != nil {
  392. if cerr := q.listProjectEntriesStmt.Close(); cerr != nil {
  393. err = fmt.Errorf("error closing listProjectEntriesStmt: %w", cerr)
  394. }
  395. }
  396. if q.listProjectRequirementStatsStmt != nil {
  397. if cerr := q.listProjectRequirementStatsStmt.Close(); cerr != nil {
  398. err = fmt.Errorf("error closing listProjectRequirementStatsStmt: %w", cerr)
  399. }
  400. }
  401. if q.listProjectRequirementsByProjectIDStmt != nil {
  402. if cerr := q.listProjectRequirementsByProjectIDStmt.Close(); cerr != nil {
  403. err = fmt.Errorf("error closing listProjectRequirementsByProjectIDStmt: %w", cerr)
  404. }
  405. }
  406. if q.listScopeMembersStmt != nil {
  407. if cerr := q.listScopeMembersStmt.Close(); cerr != nil {
  408. err = fmt.Errorf("error closing listScopeMembersStmt: %w", cerr)
  409. }
  410. }
  411. if q.listScopesStmt != nil {
  412. if cerr := q.listScopesStmt.Close(); cerr != nil {
  413. err = fmt.Errorf("error closing listScopesStmt: %w", cerr)
  414. }
  415. }
  416. if q.listScopesByUserStmt != nil {
  417. if cerr := q.listScopesByUserStmt.Close(); cerr != nil {
  418. err = fmt.Errorf("error closing listScopesByUserStmt: %w", cerr)
  419. }
  420. }
  421. if q.listStatsStmt != nil {
  422. if cerr := q.listStatsStmt.Close(); cerr != nil {
  423. err = fmt.Errorf("error closing listStatsStmt: %w", cerr)
  424. }
  425. }
  426. if q.replaceItemStatProgressStmt != nil {
  427. if cerr := q.replaceItemStatProgressStmt.Close(); cerr != nil {
  428. err = fmt.Errorf("error closing replaceItemStatProgressStmt: %w", cerr)
  429. }
  430. }
  431. if q.replaceProjectRequirementStatStmt != nil {
  432. if cerr := q.replaceProjectRequirementStatStmt.Close(); cerr != nil {
  433. err = fmt.Errorf("error closing replaceProjectRequirementStatStmt: %w", cerr)
  434. }
  435. }
  436. if q.updateItemStmt != nil {
  437. if cerr := q.updateItemStmt.Close(); cerr != nil {
  438. err = fmt.Errorf("error closing updateItemStmt: %w", cerr)
  439. }
  440. }
  441. if q.updateProjectStmt != nil {
  442. if cerr := q.updateProjectStmt.Close(); cerr != nil {
  443. err = fmt.Errorf("error closing updateProjectStmt: %w", cerr)
  444. }
  445. }
  446. if q.updateProjectRequirementStmt != nil {
  447. if cerr := q.updateProjectRequirementStmt.Close(); cerr != nil {
  448. err = fmt.Errorf("error closing updateProjectRequirementStmt: %w", cerr)
  449. }
  450. }
  451. if q.updateScopeStmt != nil {
  452. if cerr := q.updateScopeStmt.Close(); cerr != nil {
  453. err = fmt.Errorf("error closing updateScopeStmt: %w", cerr)
  454. }
  455. }
  456. if q.updateScopeMemberStmt != nil {
  457. if cerr := q.updateScopeMemberStmt.Close(); cerr != nil {
  458. err = fmt.Errorf("error closing updateScopeMemberStmt: %w", cerr)
  459. }
  460. }
  461. if q.updateStatStmt != nil {
  462. if cerr := q.updateStatStmt.Close(); cerr != nil {
  463. err = fmt.Errorf("error closing updateStatStmt: %w", cerr)
  464. }
  465. }
  466. return err
  467. }
  468. func (q *Queries) exec(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) (sql.Result, error) {
  469. switch {
  470. case stmt != nil && q.tx != nil:
  471. return q.tx.StmtContext(ctx, stmt).ExecContext(ctx, args...)
  472. case stmt != nil:
  473. return stmt.ExecContext(ctx, args...)
  474. default:
  475. return q.db.ExecContext(ctx, query, args...)
  476. }
  477. }
  478. func (q *Queries) query(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) (*sql.Rows, error) {
  479. switch {
  480. case stmt != nil && q.tx != nil:
  481. return q.tx.StmtContext(ctx, stmt).QueryContext(ctx, args...)
  482. case stmt != nil:
  483. return stmt.QueryContext(ctx, args...)
  484. default:
  485. return q.db.QueryContext(ctx, query, args...)
  486. }
  487. }
  488. func (q *Queries) queryRow(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) *sql.Row {
  489. switch {
  490. case stmt != nil && q.tx != nil:
  491. return q.tx.StmtContext(ctx, stmt).QueryRowContext(ctx, args...)
  492. case stmt != nil:
  493. return stmt.QueryRowContext(ctx, args...)
  494. default:
  495. return q.db.QueryRowContext(ctx, query, args...)
  496. }
  497. }
  498. type Queries struct {
  499. db DBTX
  500. tx *sql.Tx
  501. cLearItemStatProgressByStatStmt *sql.Stmt
  502. clearItemProjectRequirementStmt *sql.Stmt
  503. clearItemProjectRequirementByProjectIDStmt *sql.Stmt
  504. clearItemStatProgressStmt *sql.Stmt
  505. deleteAllProjectRequirementStatsStmt *sql.Stmt
  506. deleteAllProjectRequirementStatsByStatStmt *sql.Stmt
  507. deleteAllProjectRequirementsStmt *sql.Stmt
  508. deleteAllScopeMembersStmt *sql.Stmt
  509. deleteItemStmt *sql.Stmt
  510. deleteItemForRequirementStmt *sql.Stmt
  511. deleteItemStatProgressStmt *sql.Stmt
  512. deleteProjectStmt *sql.Stmt
  513. deleteProjectRequirementStmt *sql.Stmt
  514. deleteProjectRequirementStatStmt *sql.Stmt
  515. deleteScopeStmt *sql.Stmt
  516. deleteScopeMemberStmt *sql.Stmt
  517. deleteStatStmt *sql.Stmt
  518. getItemStmt *sql.Stmt
  519. getItemStatProgressBetweenStmt *sql.Stmt
  520. getProjectStmt *sql.Stmt
  521. getProjectRequirementStmt *sql.Stmt
  522. getScopeStmt *sql.Stmt
  523. getScopeDisplayNameStmt *sql.Stmt
  524. getScopeWithDisplayNameStmt *sql.Stmt
  525. getStatStmt *sql.Stmt
  526. insertItemStmt *sql.Stmt
  527. insertProjectStmt *sql.Stmt
  528. insertProjectRequirementStmt *sql.Stmt
  529. insertScopeStmt *sql.Stmt
  530. insertStatStmt *sql.Stmt
  531. listItemStatProgressStmt *sql.Stmt
  532. listItemStatProgressMultiStmt *sql.Stmt
  533. listItemsAcquiredBetweenStmt *sql.Stmt
  534. listItemsByProjectStmt *sql.Stmt
  535. listItemsCreatedBetweenStmt *sql.Stmt
  536. listItemsCreatedBetweenNoScopeStmt *sql.Stmt
  537. listItemsLooseBetweenStmt *sql.Stmt
  538. listItemsLooseBetweenNoScopeStmt *sql.Stmt
  539. listItemsScheduledBetweenStmt *sql.Stmt
  540. listItemsScheduledBetweenNoScopeStmt *sql.Stmt
  541. listProjectEntriesStmt *sql.Stmt
  542. listProjectRequirementStatsStmt *sql.Stmt
  543. listProjectRequirementsByProjectIDStmt *sql.Stmt
  544. listScopeMembersStmt *sql.Stmt
  545. listScopesStmt *sql.Stmt
  546. listScopesByUserStmt *sql.Stmt
  547. listStatsStmt *sql.Stmt
  548. replaceItemStatProgressStmt *sql.Stmt
  549. replaceProjectRequirementStatStmt *sql.Stmt
  550. updateItemStmt *sql.Stmt
  551. updateProjectStmt *sql.Stmt
  552. updateProjectRequirementStmt *sql.Stmt
  553. updateScopeStmt *sql.Stmt
  554. updateScopeMemberStmt *sql.Stmt
  555. updateStatStmt *sql.Stmt
  556. }
  557. func (q *Queries) WithTx(tx *sql.Tx) *Queries {
  558. return &Queries{
  559. db: tx,
  560. tx: tx,
  561. cLearItemStatProgressByStatStmt: q.cLearItemStatProgressByStatStmt,
  562. clearItemProjectRequirementStmt: q.clearItemProjectRequirementStmt,
  563. clearItemProjectRequirementByProjectIDStmt: q.clearItemProjectRequirementByProjectIDStmt,
  564. clearItemStatProgressStmt: q.clearItemStatProgressStmt,
  565. deleteAllProjectRequirementStatsStmt: q.deleteAllProjectRequirementStatsStmt,
  566. deleteAllProjectRequirementStatsByStatStmt: q.deleteAllProjectRequirementStatsByStatStmt,
  567. deleteAllProjectRequirementsStmt: q.deleteAllProjectRequirementsStmt,
  568. deleteAllScopeMembersStmt: q.deleteAllScopeMembersStmt,
  569. deleteItemStmt: q.deleteItemStmt,
  570. deleteItemForRequirementStmt: q.deleteItemForRequirementStmt,
  571. deleteItemStatProgressStmt: q.deleteItemStatProgressStmt,
  572. deleteProjectStmt: q.deleteProjectStmt,
  573. deleteProjectRequirementStmt: q.deleteProjectRequirementStmt,
  574. deleteProjectRequirementStatStmt: q.deleteProjectRequirementStatStmt,
  575. deleteScopeStmt: q.deleteScopeStmt,
  576. deleteScopeMemberStmt: q.deleteScopeMemberStmt,
  577. deleteStatStmt: q.deleteStatStmt,
  578. getItemStmt: q.getItemStmt,
  579. getItemStatProgressBetweenStmt: q.getItemStatProgressBetweenStmt,
  580. getProjectStmt: q.getProjectStmt,
  581. getProjectRequirementStmt: q.getProjectRequirementStmt,
  582. getScopeStmt: q.getScopeStmt,
  583. getScopeDisplayNameStmt: q.getScopeDisplayNameStmt,
  584. getScopeWithDisplayNameStmt: q.getScopeWithDisplayNameStmt,
  585. getStatStmt: q.getStatStmt,
  586. insertItemStmt: q.insertItemStmt,
  587. insertProjectStmt: q.insertProjectStmt,
  588. insertProjectRequirementStmt: q.insertProjectRequirementStmt,
  589. insertScopeStmt: q.insertScopeStmt,
  590. insertStatStmt: q.insertStatStmt,
  591. listItemStatProgressStmt: q.listItemStatProgressStmt,
  592. listItemStatProgressMultiStmt: q.listItemStatProgressMultiStmt,
  593. listItemsAcquiredBetweenStmt: q.listItemsAcquiredBetweenStmt,
  594. listItemsByProjectStmt: q.listItemsByProjectStmt,
  595. listItemsCreatedBetweenStmt: q.listItemsCreatedBetweenStmt,
  596. listItemsCreatedBetweenNoScopeStmt: q.listItemsCreatedBetweenNoScopeStmt,
  597. listItemsLooseBetweenStmt: q.listItemsLooseBetweenStmt,
  598. listItemsLooseBetweenNoScopeStmt: q.listItemsLooseBetweenNoScopeStmt,
  599. listItemsScheduledBetweenStmt: q.listItemsScheduledBetweenStmt,
  600. listItemsScheduledBetweenNoScopeStmt: q.listItemsScheduledBetweenNoScopeStmt,
  601. listProjectEntriesStmt: q.listProjectEntriesStmt,
  602. listProjectRequirementStatsStmt: q.listProjectRequirementStatsStmt,
  603. listProjectRequirementsByProjectIDStmt: q.listProjectRequirementsByProjectIDStmt,
  604. listScopeMembersStmt: q.listScopeMembersStmt,
  605. listScopesStmt: q.listScopesStmt,
  606. listScopesByUserStmt: q.listScopesByUserStmt,
  607. listStatsStmt: q.listStatsStmt,
  608. replaceItemStatProgressStmt: q.replaceItemStatProgressStmt,
  609. replaceProjectRequirementStatStmt: q.replaceProjectRequirementStatStmt,
  610. updateItemStmt: q.updateItemStmt,
  611. updateProjectStmt: q.updateProjectStmt,
  612. updateProjectRequirementStmt: q.updateProjectRequirementStmt,
  613. updateScopeStmt: q.updateScopeStmt,
  614. updateScopeMemberStmt: q.updateScopeMemberStmt,
  615. updateStatStmt: q.updateStatStmt,
  616. }
  617. }