|
|
|
@ -383,8 +383,18 @@ CREATE TABLE nodes (
|
|
|
|
|
updated_at timestamp with time zone NOT NULL,
|
|
|
|
|
last_contact_success timestamp with time zone NOT NULL,
|
|
|
|
|
last_contact_failure timestamp with time zone NOT NULL,
|
|
|
|
|
contained boolean NOT NULL,
|
|
|
|
|
PRIMARY KEY ( id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE pending_audits (
|
|
|
|
|
node_id bytea NOT NULL,
|
|
|
|
|
piece_id bytea NOT NULL,
|
|
|
|
|
stripe_index bigint NOT NULL,
|
|
|
|
|
share_size bigint NOT NULL,
|
|
|
|
|
expected_share_hash bytea NOT NULL,
|
|
|
|
|
reverify_count bigint NOT NULL,
|
|
|
|
|
PRIMARY KEY ( node_id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE projects (
|
|
|
|
|
id bytea NOT NULL,
|
|
|
|
|
name text NOT NULL,
|
|
|
|
@ -640,8 +650,18 @@ CREATE TABLE nodes (
|
|
|
|
|
updated_at TIMESTAMP NOT NULL,
|
|
|
|
|
last_contact_success TIMESTAMP NOT NULL,
|
|
|
|
|
last_contact_failure TIMESTAMP NOT NULL,
|
|
|
|
|
contained INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY ( id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE pending_audits (
|
|
|
|
|
node_id BLOB NOT NULL,
|
|
|
|
|
piece_id BLOB NOT NULL,
|
|
|
|
|
stripe_index INTEGER NOT NULL,
|
|
|
|
|
share_size INTEGER NOT NULL,
|
|
|
|
|
expected_share_hash BLOB NOT NULL,
|
|
|
|
|
reverify_count INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY ( node_id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE projects (
|
|
|
|
|
id BLOB NOT NULL,
|
|
|
|
|
name TEXT NOT NULL,
|
|
|
|
@ -2072,6 +2092,7 @@ type Node struct {
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
LastContactSuccess time.Time
|
|
|
|
|
LastContactFailure time.Time
|
|
|
|
|
Contained bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Node) _Table() string { return "nodes" }
|
|
|
|
@ -2099,6 +2120,7 @@ type Node_Update_Fields struct {
|
|
|
|
|
UptimeRatio Node_UptimeRatio_Field
|
|
|
|
|
LastContactSuccess Node_LastContactSuccess_Field
|
|
|
|
|
LastContactFailure Node_LastContactFailure_Field
|
|
|
|
|
Contained Node_Contained_Field
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Node_Id_Field struct {
|
|
|
|
@ -2576,6 +2598,154 @@ func (f Node_LastContactFailure_Field) value() interface{} {
|
|
|
|
|
|
|
|
|
|
func (Node_LastContactFailure_Field) _Column() string { return "last_contact_failure" }
|
|
|
|
|
|
|
|
|
|
type Node_Contained_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func Node_Contained(v bool) Node_Contained_Field {
|
|
|
|
|
return Node_Contained_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f Node_Contained_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Node_Contained_Field) _Column() string { return "contained" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits struct {
|
|
|
|
|
NodeId []byte
|
|
|
|
|
PieceId []byte
|
|
|
|
|
StripeIndex int64
|
|
|
|
|
ShareSize int64
|
|
|
|
|
ExpectedShareHash []byte
|
|
|
|
|
ReverifyCount int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits) _Table() string { return "pending_audits" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_Update_Fields struct {
|
|
|
|
|
ReverifyCount PendingAudits_ReverifyCount_Field
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PendingAudits_NodeId_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value []byte
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_NodeId(v []byte) PendingAudits_NodeId_Field {
|
|
|
|
|
return PendingAudits_NodeId_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_NodeId_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_NodeId_Field) _Column() string { return "node_id" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_PieceId_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value []byte
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_PieceId(v []byte) PendingAudits_PieceId_Field {
|
|
|
|
|
return PendingAudits_PieceId_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_PieceId_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_PieceId_Field) _Column() string { return "piece_id" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_StripeIndex_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_StripeIndex(v int64) PendingAudits_StripeIndex_Field {
|
|
|
|
|
return PendingAudits_StripeIndex_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_StripeIndex_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_StripeIndex_Field) _Column() string { return "stripe_index" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_ShareSize_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_ShareSize(v int64) PendingAudits_ShareSize_Field {
|
|
|
|
|
return PendingAudits_ShareSize_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_ShareSize_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_ShareSize_Field) _Column() string { return "share_size" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_ExpectedShareHash_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value []byte
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_ExpectedShareHash(v []byte) PendingAudits_ExpectedShareHash_Field {
|
|
|
|
|
return PendingAudits_ExpectedShareHash_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_ExpectedShareHash_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_ExpectedShareHash_Field) _Column() string { return "expected_share_hash" }
|
|
|
|
|
|
|
|
|
|
type PendingAudits_ReverifyCount_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func PendingAudits_ReverifyCount(v int64) PendingAudits_ReverifyCount_Field {
|
|
|
|
|
return PendingAudits_ReverifyCount_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f PendingAudits_ReverifyCount_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (PendingAudits_ReverifyCount_Field) _Column() string { return "reverify_count" }
|
|
|
|
|
|
|
|
|
|
type Project struct {
|
|
|
|
|
Id []byte
|
|
|
|
|
Name string
|
|
|
|
@ -3765,6 +3935,35 @@ type Value_Row struct {
|
|
|
|
|
Value time.Time
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Create_PendingAudits(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
pending_audits_piece_id PendingAudits_PieceId_Field,
|
|
|
|
|
pending_audits_stripe_index PendingAudits_StripeIndex_Field,
|
|
|
|
|
pending_audits_share_size PendingAudits_ShareSize_Field,
|
|
|
|
|
pending_audits_expected_share_hash PendingAudits_ExpectedShareHash_Field,
|
|
|
|
|
pending_audits_reverify_count PendingAudits_ReverifyCount_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
__node_id_val := pending_audits_node_id.value()
|
|
|
|
|
__piece_id_val := pending_audits_piece_id.value()
|
|
|
|
|
__stripe_index_val := pending_audits_stripe_index.value()
|
|
|
|
|
__share_size_val := pending_audits_share_size.value()
|
|
|
|
|
__expected_share_hash_val := pending_audits_expected_share_hash.value()
|
|
|
|
|
__reverify_count_val := pending_audits_reverify_count.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO pending_audits ( node_id, piece_id, stripe_index, share_size, expected_share_hash, reverify_count ) VALUES ( ?, ?, ?, ?, ?, ? ) RETURNING pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __node_id_val, __piece_id_val, __stripe_index_val, __share_size_val, __expected_share_hash_val, __reverify_count_val)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __node_id_val, __piece_id_val, __stripe_index_val, __share_size_val, __expected_share_hash_val, __reverify_count_val).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Create_Irreparabledb(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field,
|
|
|
|
|
irreparabledb_segmentdetail Irreparabledb_Segmentdetail_Field,
|
|
|
|
@ -3869,7 +4068,8 @@ func (obj *postgresImpl) Create_Node(ctx context.Context,
|
|
|
|
|
node_total_uptime_count Node_TotalUptimeCount_Field,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field) (
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
@ -3898,14 +4098,15 @@ func (obj *postgresImpl) Create_Node(ctx context.Context,
|
|
|
|
|
__updated_at_val := __now
|
|
|
|
|
__last_contact_success_val := node_last_contact_success.value()
|
|
|
|
|
__last_contact_failure_val := node_last_contact_failure.value()
|
|
|
|
|
__contained_val := node_contained.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, protocol, type, email, wallet, free_bandwidth, free_disk, major, minor, patch, hash, timestamp, release, latency_90, audit_success_count, total_audit_count, audit_success_ratio, uptime_success_count, total_uptime_count, uptime_ratio, created_at, updated_at, last_contact_success, last_contact_failure ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) RETURNING nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, protocol, type, email, wallet, free_bandwidth, free_disk, major, minor, patch, hash, timestamp, release, latency_90, audit_success_count, total_audit_count, audit_success_ratio, uptime_success_count, total_uptime_count, uptime_ratio, created_at, updated_at, last_contact_success, last_contact_failure, contained ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) RETURNING nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val, __contained_val)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val, __contained_val).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -4239,6 +4440,27 @@ func (obj *postgresImpl) Create_ResetPasswordToken(ctx context.Context,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Get_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count FROM pending_audits WHERE pending_audits.node_id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Get_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) (
|
|
|
|
|
irreparabledb *Irreparabledb, err error) {
|
|
|
|
@ -4377,7 +4599,7 @@ func (obj *postgresImpl) Get_Node_By_Id(ctx context.Context,
|
|
|
|
|
node_id Node_Id_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id.value())
|
|
|
|
@ -4386,7 +4608,7 @@ func (obj *postgresImpl) Get_Node_By_Id(ctx context.Context,
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -4431,7 +4653,7 @@ func (obj *postgresImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx co
|
|
|
|
|
limit int, offset int64) (
|
|
|
|
|
rows []*Node, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id_greater_or_equal.value())
|
|
|
|
@ -4449,7 +4671,7 @@ func (obj *postgresImpl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx co
|
|
|
|
|
|
|
|
|
|
for __rows.Next() {
|
|
|
|
|
node := &Node{}
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -5251,6 +5473,46 @@ func (obj *postgresImpl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Update_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
update PendingAudits_Update_Fields) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
var __sets = &__sqlbundle_Hole{}
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE pending_audits SET "), __sets, __sqlbundle_Literal(" WHERE pending_audits.node_id = ? RETURNING pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count")}}
|
|
|
|
|
|
|
|
|
|
__sets_sql := __sqlbundle_Literals{Join: ", "}
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
var __args []interface{}
|
|
|
|
|
|
|
|
|
|
if update.ReverifyCount._set {
|
|
|
|
|
__values = append(__values, update.ReverifyCount.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("reverify_count = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(__sets_sql.SQLs) == 0 {
|
|
|
|
|
return nil, emptyUpdate()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__args = append(__args, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __args...)
|
|
|
|
|
__sets.SQL = __sets_sql
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Update_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field,
|
|
|
|
|
update Irreparabledb_Update_Fields) (
|
|
|
|
@ -5352,7 +5614,7 @@ func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
var __sets = &__sqlbundle_Hole{}
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE nodes SET "), __sets, __sqlbundle_Literal(" WHERE nodes.id = ? RETURNING nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure")}}
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE nodes SET "), __sets, __sqlbundle_Literal(" WHERE nodes.id = ? RETURNING nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained")}}
|
|
|
|
|
|
|
|
|
|
__sets_sql := __sqlbundle_Literals{Join: ", "}
|
|
|
|
|
var __values []interface{}
|
|
|
|
@ -5468,6 +5730,11 @@ func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("last_contact_failure = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if update.Contained._set {
|
|
|
|
|
__values = append(__values, update.Contained.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("contained = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __now)
|
|
|
|
@ -5482,7 +5749,7 @@ func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
@ -5708,6 +5975,32 @@ func (obj *postgresImpl) Update_RegistrationToken_By_Secret(ctx context.Context,
|
|
|
|
|
return registration_token, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Delete_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
deleted bool, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("DELETE FROM pending_audits WHERE pending_audits.node_id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __values...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err := __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return __count > 0, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *postgresImpl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) (
|
|
|
|
|
deleted bool, err error) {
|
|
|
|
@ -6129,6 +6422,16 @@ func (obj *postgresImpl) deleteAll(ctx context.Context) (count int64, err error)
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err = __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
count += __count
|
|
|
|
|
__res, err = obj.driver.Exec("DELETE FROM pending_audits;")
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err = __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
@ -6239,6 +6542,38 @@ func (obj *postgresImpl) deleteAll(ctx context.Context) (count int64, err error)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Create_PendingAudits(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
pending_audits_piece_id PendingAudits_PieceId_Field,
|
|
|
|
|
pending_audits_stripe_index PendingAudits_StripeIndex_Field,
|
|
|
|
|
pending_audits_share_size PendingAudits_ShareSize_Field,
|
|
|
|
|
pending_audits_expected_share_hash PendingAudits_ExpectedShareHash_Field,
|
|
|
|
|
pending_audits_reverify_count PendingAudits_ReverifyCount_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
__node_id_val := pending_audits_node_id.value()
|
|
|
|
|
__piece_id_val := pending_audits_piece_id.value()
|
|
|
|
|
__stripe_index_val := pending_audits_stripe_index.value()
|
|
|
|
|
__share_size_val := pending_audits_share_size.value()
|
|
|
|
|
__expected_share_hash_val := pending_audits_expected_share_hash.value()
|
|
|
|
|
__reverify_count_val := pending_audits_reverify_count.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO pending_audits ( node_id, piece_id, stripe_index, share_size, expected_share_hash, reverify_count ) VALUES ( ?, ?, ?, ?, ?, ? )")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __node_id_val, __piece_id_val, __stripe_index_val, __share_size_val, __expected_share_hash_val, __reverify_count_val)
|
|
|
|
|
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __node_id_val, __piece_id_val, __stripe_index_val, __share_size_val, __expected_share_hash_val, __reverify_count_val)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
__pk, err := __res.LastInsertId()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return obj.getLastPendingAudits(ctx, __pk)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Create_Irreparabledb(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field,
|
|
|
|
|
irreparabledb_segmentdetail Irreparabledb_Segmentdetail_Field,
|
|
|
|
@ -6352,7 +6687,8 @@ func (obj *sqlite3Impl) Create_Node(ctx context.Context,
|
|
|
|
|
node_total_uptime_count Node_TotalUptimeCount_Field,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field) (
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
@ -6381,13 +6717,14 @@ func (obj *sqlite3Impl) Create_Node(ctx context.Context,
|
|
|
|
|
__updated_at_val := __now
|
|
|
|
|
__last_contact_success_val := node_last_contact_success.value()
|
|
|
|
|
__last_contact_failure_val := node_last_contact_failure.value()
|
|
|
|
|
__contained_val := node_contained.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, protocol, type, email, wallet, free_bandwidth, free_disk, major, minor, patch, hash, timestamp, release, latency_90, audit_success_count, total_audit_count, audit_success_ratio, uptime_success_count, total_uptime_count, uptime_ratio, created_at, updated_at, last_contact_success, last_contact_failure ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, protocol, type, email, wallet, free_bandwidth, free_disk, major, minor, patch, hash, timestamp, release, latency_90, audit_success_count, total_audit_count, audit_success_ratio, uptime_success_count, total_uptime_count, uptime_ratio, created_at, updated_at, last_contact_success, last_contact_failure, contained ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val, __contained_val)
|
|
|
|
|
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val)
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __id_val, __address_val, __protocol_val, __type_val, __email_val, __wallet_val, __free_bandwidth_val, __free_disk_val, __major_val, __minor_val, __patch_val, __hash_val, __timestamp_val, __release_val, __latency_90_val, __audit_success_count_val, __total_audit_count_val, __audit_success_ratio_val, __uptime_success_count_val, __total_uptime_count_val, __uptime_ratio_val, __created_at_val, __updated_at_val, __last_contact_success_val, __last_contact_failure_val, __contained_val)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -6761,6 +7098,27 @@ func (obj *sqlite3Impl) Create_ResetPasswordToken(ctx context.Context,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Get_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count FROM pending_audits WHERE pending_audits.node_id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Get_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) (
|
|
|
|
|
irreparabledb *Irreparabledb, err error) {
|
|
|
|
@ -6899,7 +7257,7 @@ func (obj *sqlite3Impl) Get_Node_By_Id(ctx context.Context,
|
|
|
|
|
node_id Node_Id_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id.value())
|
|
|
|
@ -6908,7 +7266,7 @@ func (obj *sqlite3Impl) Get_Node_By_Id(ctx context.Context,
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -6953,7 +7311,7 @@ func (obj *sqlite3Impl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx con
|
|
|
|
|
limit int, offset int64) (
|
|
|
|
|
rows []*Node, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id_greater_or_equal.value())
|
|
|
|
@ -6971,7 +7329,7 @@ func (obj *sqlite3Impl) Limited_Node_By_Id_GreaterOrEqual_OrderBy_Asc_Id(ctx con
|
|
|
|
|
|
|
|
|
|
for __rows.Next() {
|
|
|
|
|
node := &Node{}
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -7773,6 +8131,56 @@ func (obj *sqlite3Impl) Get_ResetPasswordToken_By_OwnerId(ctx context.Context,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Update_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
update PendingAudits_Update_Fields) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
var __sets = &__sqlbundle_Hole{}
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE pending_audits SET "), __sets, __sqlbundle_Literal(" WHERE pending_audits.node_id = ?")}}
|
|
|
|
|
|
|
|
|
|
__sets_sql := __sqlbundle_Literals{Join: ", "}
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
var __args []interface{}
|
|
|
|
|
|
|
|
|
|
if update.ReverifyCount._set {
|
|
|
|
|
__values = append(__values, update.ReverifyCount.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("reverify_count = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(__sets_sql.SQLs) == 0 {
|
|
|
|
|
return nil, emptyUpdate()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__args = append(__args, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __args...)
|
|
|
|
|
__sets.SQL = __sets_sql
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
_, err = obj.driver.Exec(__stmt, __values...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var __embed_stmt_get = __sqlbundle_Literal("SELECT pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count FROM pending_audits WHERE pending_audits.node_id = ?")
|
|
|
|
|
|
|
|
|
|
var __stmt_get = __sqlbundle_Render(obj.dialect, __embed_stmt_get)
|
|
|
|
|
obj.logStmt("(IMPLIED) "+__stmt_get, __args...)
|
|
|
|
|
|
|
|
|
|
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Update_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field,
|
|
|
|
|
update Irreparabledb_Update_Fields) (
|
|
|
|
@ -8010,6 +8418,11 @@ func (obj *sqlite3Impl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("last_contact_failure = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if update.Contained._set {
|
|
|
|
|
__values = append(__values, update.Contained.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("contained = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __now)
|
|
|
|
@ -8029,12 +8442,12 @@ func (obj *sqlite3Impl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var __embed_stmt_get = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
var __embed_stmt_get = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
|
|
|
|
|
var __stmt_get = __sqlbundle_Render(obj.dialect, __embed_stmt_get)
|
|
|
|
|
obj.logStmt("(IMPLIED) "+__stmt_get, __args...)
|
|
|
|
|
|
|
|
|
|
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
@ -8310,6 +8723,32 @@ func (obj *sqlite3Impl) Update_RegistrationToken_By_Secret(ctx context.Context,
|
|
|
|
|
return registration_token, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Delete_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
deleted bool, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("DELETE FROM pending_audits WHERE pending_audits.node_id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, pending_audits_node_id.value())
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
|
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __values...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err := __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return __count > 0, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) Delete_Irreparabledb_By_Segmentpath(ctx context.Context,
|
|
|
|
|
irreparabledb_segmentpath Irreparabledb_Segmentpath_Field) (
|
|
|
|
|
deleted bool, err error) {
|
|
|
|
@ -8623,6 +9062,24 @@ func (obj *sqlite3Impl) Delete_ResetPasswordToken_By_Secret(ctx context.Context,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) getLastPendingAudits(ctx context.Context,
|
|
|
|
|
pk int64) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT pending_audits.node_id, pending_audits.piece_id, pending_audits.stripe_index, pending_audits.share_size, pending_audits.expected_share_hash, pending_audits.reverify_count FROM pending_audits WHERE _rowid_ = ?")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, pk)
|
|
|
|
|
|
|
|
|
|
pending_audits = &PendingAudits{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, pk).Scan(&pending_audits.NodeId, &pending_audits.PieceId, &pending_audits.StripeIndex, &pending_audits.ShareSize, &pending_audits.ExpectedShareHash, &pending_audits.ReverifyCount)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
return pending_audits, nil
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (obj *sqlite3Impl) getLastIrreparabledb(ctx context.Context,
|
|
|
|
|
pk int64) (
|
|
|
|
|
irreparabledb *Irreparabledb, err error) {
|
|
|
|
@ -8681,13 +9138,13 @@ func (obj *sqlite3Impl) getLastNode(ctx context.Context,
|
|
|
|
|
pk int64) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure FROM nodes WHERE _rowid_ = ?")
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.protocol, nodes.type, nodes.email, nodes.wallet, nodes.free_bandwidth, nodes.free_disk, nodes.major, nodes.minor, nodes.patch, nodes.hash, nodes.timestamp, nodes.release, nodes.latency_90, nodes.audit_success_count, nodes.total_audit_count, nodes.audit_success_ratio, nodes.uptime_success_count, nodes.total_uptime_count, nodes.uptime_ratio, nodes.created_at, nodes.updated_at, nodes.last_contact_success, nodes.last_contact_failure, nodes.contained FROM nodes WHERE _rowid_ = ?")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, pk)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, pk).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, pk).Scan(&node.Id, &node.Address, &node.Protocol, &node.Type, &node.Email, &node.Wallet, &node.FreeBandwidth, &node.FreeDisk, &node.Major, &node.Minor, &node.Patch, &node.Hash, &node.Timestamp, &node.Release, &node.Latency90, &node.AuditSuccessCount, &node.TotalAuditCount, &node.AuditSuccessRatio, &node.UptimeSuccessCount, &node.TotalUptimeCount, &node.UptimeRatio, &node.CreatedAt, &node.UpdatedAt, &node.LastContactSuccess, &node.LastContactFailure, &node.Contained)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -9024,6 +9481,16 @@ func (obj *sqlite3Impl) deleteAll(ctx context.Context) (count int64, err error)
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err = __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
count += __count
|
|
|
|
|
__res, err = obj.driver.Exec("DELETE FROM pending_audits;")
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__count, err = __res.RowsAffected()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return 0, obj.makeErr(err)
|
|
|
|
@ -9411,13 +9878,30 @@ func (rx *Rx) Create_Node(ctx context.Context,
|
|
|
|
|
node_total_uptime_count Node_TotalUptimeCount_Field,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field) (
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
var tx *Tx
|
|
|
|
|
if tx, err = rx.getTx(ctx); err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return tx.Create_Node(ctx, node_id, node_address, node_protocol, node_type, node_email, node_wallet, node_free_bandwidth, node_free_disk, node_major, node_minor, node_patch, node_hash, node_timestamp, node_release, node_latency_90, node_audit_success_count, node_total_audit_count, node_audit_success_ratio, node_uptime_success_count, node_total_uptime_count, node_uptime_ratio, node_last_contact_success, node_last_contact_failure)
|
|
|
|
|
return tx.Create_Node(ctx, node_id, node_address, node_protocol, node_type, node_email, node_wallet, node_free_bandwidth, node_free_disk, node_major, node_minor, node_patch, node_hash, node_timestamp, node_release, node_latency_90, node_audit_success_count, node_total_audit_count, node_audit_success_ratio, node_uptime_success_count, node_total_uptime_count, node_uptime_ratio, node_last_contact_success, node_last_contact_failure, node_contained)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Create_PendingAudits(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
pending_audits_piece_id PendingAudits_PieceId_Field,
|
|
|
|
|
pending_audits_stripe_index PendingAudits_StripeIndex_Field,
|
|
|
|
|
pending_audits_share_size PendingAudits_ShareSize_Field,
|
|
|
|
|
pending_audits_expected_share_hash PendingAudits_ExpectedShareHash_Field,
|
|
|
|
|
pending_audits_reverify_count PendingAudits_ReverifyCount_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
var tx *Tx
|
|
|
|
|
if tx, err = rx.getTx(ctx); err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return tx.Create_PendingAudits(ctx, pending_audits_node_id, pending_audits_piece_id, pending_audits_stripe_index, pending_audits_share_size, pending_audits_expected_share_hash, pending_audits_reverify_count)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -9584,6 +10068,16 @@ func (rx *Rx) Delete_Node_By_Id(ctx context.Context,
|
|
|
|
|
return tx.Delete_Node_By_Id(ctx, node_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Delete_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
deleted bool, err error) {
|
|
|
|
|
var tx *Tx
|
|
|
|
|
if tx, err = rx.getTx(ctx); err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return tx.Delete_PendingAudits_By_NodeId(ctx, pending_audits_node_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context,
|
|
|
|
|
project_member_member_id ProjectMember_MemberId_Field,
|
|
|
|
|
project_member_project_id ProjectMember_ProjectId_Field) (
|
|
|
|
@ -9771,6 +10265,16 @@ func (rx *Rx) Get_Node_By_Id(ctx context.Context,
|
|
|
|
|
return tx.Get_Node_By_Id(ctx, node_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Get_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
var tx *Tx
|
|
|
|
|
if tx, err = rx.getTx(ctx); err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return tx.Get_PendingAudits_By_NodeId(ctx, pending_audits_node_id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Get_Project_By_Id(ctx context.Context,
|
|
|
|
|
project_id Project_Id_Field) (
|
|
|
|
|
project *Project, err error) {
|
|
|
|
@ -9964,6 +10468,17 @@ func (rx *Rx) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
return tx.Update_Node_By_Id(ctx, node_id, update)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Update_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
update PendingAudits_Update_Fields) (
|
|
|
|
|
pending_audits *PendingAudits, err error) {
|
|
|
|
|
var tx *Tx
|
|
|
|
|
if tx, err = rx.getTx(ctx); err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return tx.Update_PendingAudits_By_NodeId(ctx, pending_audits_node_id, update)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (rx *Rx) Update_Project_By_Id(ctx context.Context,
|
|
|
|
|
project_id Project_Id_Field,
|
|
|
|
|
update Project_Update_Fields) (
|
|
|
|
@ -10124,9 +10639,19 @@ type Methods interface {
|
|
|
|
|
node_total_uptime_count Node_TotalUptimeCount_Field,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field) (
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node *Node, err error)
|
|
|
|
|
|
|
|
|
|
Create_PendingAudits(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
pending_audits_piece_id PendingAudits_PieceId_Field,
|
|
|
|
|
pending_audits_stripe_index PendingAudits_StripeIndex_Field,
|
|
|
|
|
pending_audits_share_size PendingAudits_ShareSize_Field,
|
|
|
|
|
pending_audits_expected_share_hash PendingAudits_ExpectedShareHash_Field,
|
|
|
|
|
pending_audits_reverify_count PendingAudits_ReverifyCount_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error)
|
|
|
|
|
|
|
|
|
|
Create_Project(ctx context.Context,
|
|
|
|
|
project_id Project_Id_Field,
|
|
|
|
|
project_name Project_Name_Field,
|
|
|
|
@ -10198,6 +10723,10 @@ type Methods interface {
|
|
|
|
|
node_id Node_Id_Field) (
|
|
|
|
|
deleted bool, err error)
|
|
|
|
|
|
|
|
|
|
Delete_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
deleted bool, err error)
|
|
|
|
|
|
|
|
|
|
Delete_ProjectMember_By_MemberId_And_ProjectId(ctx context.Context,
|
|
|
|
|
project_member_member_id ProjectMember_MemberId_Field,
|
|
|
|
|
project_member_project_id ProjectMember_ProjectId_Field) (
|
|
|
|
@ -10276,6 +10805,10 @@ type Methods interface {
|
|
|
|
|
node_id Node_Id_Field) (
|
|
|
|
|
node *Node, err error)
|
|
|
|
|
|
|
|
|
|
Get_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field) (
|
|
|
|
|
pending_audits *PendingAudits, err error)
|
|
|
|
|
|
|
|
|
|
Get_Project_By_Id(ctx context.Context,
|
|
|
|
|
project_id Project_Id_Field) (
|
|
|
|
|
project *Project, err error)
|
|
|
|
@ -10361,6 +10894,11 @@ type Methods interface {
|
|
|
|
|
update Node_Update_Fields) (
|
|
|
|
|
node *Node, err error)
|
|
|
|
|
|
|
|
|
|
Update_PendingAudits_By_NodeId(ctx context.Context,
|
|
|
|
|
pending_audits_node_id PendingAudits_NodeId_Field,
|
|
|
|
|
update PendingAudits_Update_Fields) (
|
|
|
|
|
pending_audits *PendingAudits, err error)
|
|
|
|
|
|
|
|
|
|
Update_Project_By_Id(ctx context.Context,
|
|
|
|
|
project_id Project_Id_Field,
|
|
|
|
|
update Project_Update_Fields) (
|
|
|
|
|