337 std::reference_wrapper<SettingsProviderType const> settingsProvider_;
338 std::reference_wrapper<Handle const> handle_;
348 : settingsProvider_{settingsProvider}, handle_{std::cref(handle)}
357 return handle_.get().prepare(
361 (key, sequence, object)
370 return handle_.get().prepare(
374 (hash, ledger_sequence, date, transaction, metadata)
375 VALUES (?, ?, ?, ?, ?)
382 PreparedStatement insertLedgerTransaction = [
this]() {
383 return handle_.get().prepare(
387 (ledger_sequence, hash)
395 PreparedStatement insertSuccessor = [
this]() {
396 return handle_.get().prepare(
408 PreparedStatement insertDiff = [
this]() {
409 return handle_.get().prepare(
421 PreparedStatement insertAccountTx = [
this]() {
422 return handle_.get().prepare(
426 (account, seq_idx, hash)
434 PreparedStatement insertNFT = [
this]() {
435 return handle_.get().prepare(
439 (token_id, sequence, owner, is_burned)
447 PreparedStatement insertIssuerNFT = [
this]() {
448 return handle_.get().prepare(
452 (issuer, taxon, token_id)
460 PreparedStatement insertNFTURI = [
this]() {
461 return handle_.get().prepare(
465 (token_id, sequence, uri)
473 PreparedStatement insertNFTTx = [
this]() {
474 return handle_.get().prepare(
478 (token_id, seq_idx, hash)
486 PreparedStatement insertMPTHolder = [
this]() {
487 return handle_.get().prepare(
499 PreparedStatement insertLedgerHeader = [
this]() {
500 return handle_.get().prepare(
512 PreparedStatement insertLedgerHash = [
this]() {
513 return handle_.get().prepare(
529 PreparedStatement updateLedgerRange = [
this]() {
530 return handle_.get().prepare(
536 IF sequence IN (?, null)
543 PreparedStatement deleteLedgerRange = [
this]() {
544 return handle_.get().prepare(
549 WHERE is_latest = False
556 PreparedStatement insertMigratorStatus = [
this]() {
557 return handle_.get().prepare(
561 (migrator_name, status)
569 PreparedStatement updateClioNodeMessage = [
this]() {
570 return handle_.get().prepare(
586 PreparedStatement selectSuccessor = [
this]() {
587 return handle_.get().prepare(
602 PreparedStatement selectDiff = [
this]() {
603 return handle_.get().prepare(
615 PreparedStatement selectObject = [
this]() {
616 return handle_.get().prepare(
619 SELECT object, sequence
623 ORDER BY sequence DESC
631 PreparedStatement selectTransaction = [
this]() {
632 return handle_.get().prepare(
635 SELECT transaction, metadata, ledger_sequence, date
644 PreparedStatement selectAllTransactionHashesInLedger = [
this]() {
645 return handle_.get().prepare(
650 WHERE ledger_sequence = ?
657 PreparedStatement selectLedgerPageKeys = [
this]() {
658 return handle_.get().prepare(
663 WHERE TOKEN(key) >= ?
665 PER PARTITION LIMIT 1
674 PreparedStatement selectLedgerPage = [
this]() {
675 return handle_.get().prepare(
680 WHERE TOKEN(key) >= ?
682 PER PARTITION LIMIT 1
691 PreparedStatement getToken = [
this]() {
692 return handle_.get().prepare(
705 PreparedStatement selectAccountTx = [
this]() {
706 return handle_.get().prepare(
720 PreparedStatement selectAccountFromBeginning = [
this]() {
721 return handle_.get().prepare(
726 WHERE token(account) > 0
727 PER PARTITION LIMIT 1
735 PreparedStatement selectAccountFromToken = [
this]() {
736 return handle_.get().prepare(
741 WHERE token(account) > token(?)
742 PER PARTITION LIMIT 1
750 PreparedStatement selectAccountTxForward = [
this]() {
751 return handle_.get().prepare(
766 PreparedStatement selectNFT = [
this]() {
767 return handle_.get().prepare(
770 SELECT sequence, owner, is_burned
774 ORDER BY sequence DESC
782 PreparedStatement selectNFTURI = [
this]() {
783 return handle_.get().prepare(
790 ORDER BY sequence DESC
798 PreparedStatement selectNFTTx = [
this]() {
799 return handle_.get().prepare(
806 ORDER BY seq_idx DESC
814 PreparedStatement selectNFTTxForward = [
this]() {
815 return handle_.get().prepare(
830 PreparedStatement selectNFTIDsByIssuer = [
this]() {
831 return handle_.get().prepare(
837 AND (taxon, token_id) > ?
838 ORDER BY taxon ASC, token_id ASC
846 PreparedStatement selectNFTIDsByIssuerTaxon = [
this]() {
847 return handle_.get().prepare(
855 ORDER BY taxon ASC, token_id ASC
863 PreparedStatement selectMPTHolders = [
this]() {
864 return handle_.get().prepare(
879 PreparedStatement selectLedgerByHash = [
this]() {
880 return handle_.get().prepare(
893 PreparedStatement selectLedgerBySeq = [
this]() {
894 return handle_.get().prepare(
906 PreparedStatement selectLatestLedger = [
this]() {
907 return handle_.get().prepare(
912 WHERE is_latest = True
919 PreparedStatement selectLedgerRange = [
this]() {
920 return handle_.get().prepare(
925 WHERE is_latest in (True, False)
932 PreparedStatement selectMigratorStatus = [
this]() {
933 return handle_.get().prepare(
938 WHERE migrator_name = ?
945 PreparedStatement selectClioNodesData = [
this]() {
946 return handle_.get().prepare(
949 SELECT node_id, message