|
|
|
@ -385,6 +385,7 @@ CREATE TABLE nodes (
|
|
|
|
|
last_contact_success timestamp with time zone NOT NULL,
|
|
|
|
|
last_contact_failure timestamp with time zone NOT NULL,
|
|
|
|
|
contained boolean NOT NULL,
|
|
|
|
|
disqualified boolean NOT NULL,
|
|
|
|
|
PRIMARY KEY ( id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE offers (
|
|
|
|
@ -671,6 +672,7 @@ CREATE TABLE nodes (
|
|
|
|
|
last_contact_success TIMESTAMP NOT NULL,
|
|
|
|
|
last_contact_failure TIMESTAMP NOT NULL,
|
|
|
|
|
contained INTEGER NOT NULL,
|
|
|
|
|
disqualified INTEGER NOT NULL,
|
|
|
|
|
PRIMARY KEY ( id )
|
|
|
|
|
);
|
|
|
|
|
CREATE TABLE offers (
|
|
|
|
@ -2132,6 +2134,7 @@ type Node struct {
|
|
|
|
|
LastContactSuccess time.Time
|
|
|
|
|
LastContactFailure time.Time
|
|
|
|
|
Contained bool
|
|
|
|
|
Disqualified bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Node) _Table() string { return "nodes" }
|
|
|
|
@ -2161,6 +2164,7 @@ type Node_Update_Fields struct {
|
|
|
|
|
LastContactSuccess Node_LastContactSuccess_Field
|
|
|
|
|
LastContactFailure Node_LastContactFailure_Field
|
|
|
|
|
Contained Node_Contained_Field
|
|
|
|
|
Disqualified Node_Disqualified_Field
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Node_Id_Field struct {
|
|
|
|
@ -2676,6 +2680,25 @@ func (f Node_Contained_Field) value() interface{} {
|
|
|
|
|
|
|
|
|
|
func (Node_Contained_Field) _Column() string { return "contained" }
|
|
|
|
|
|
|
|
|
|
type Node_Disqualified_Field struct {
|
|
|
|
|
_set bool
|
|
|
|
|
_null bool
|
|
|
|
|
_value bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func Node_Disqualified(v bool) Node_Disqualified_Field {
|
|
|
|
|
return Node_Disqualified_Field{_set: true, _value: v}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (f Node_Disqualified_Field) value() interface{} {
|
|
|
|
|
if !f._set || f._null {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
return f._value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Node_Disqualified_Field) _Column() string { return "disqualified" }
|
|
|
|
|
|
|
|
|
|
type Offer struct {
|
|
|
|
|
Id int
|
|
|
|
|
Name string
|
|
|
|
@ -4441,7 +4464,8 @@ func (obj *postgresImpl) Create_Node(ctx context.Context,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node_contained Node_Contained_Field,
|
|
|
|
|
node_disqualified Node_Disqualified_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
@ -4472,14 +4496,15 @@ func (obj *postgresImpl) Create_Node(ctx context.Context,
|
|
|
|
|
__last_contact_success_val := node_last_contact_success.value()
|
|
|
|
|
__last_contact_failure_val := node_last_contact_failure.value()
|
|
|
|
|
__contained_val := node_contained.value()
|
|
|
|
|
__disqualified_val := node_disqualified.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, last_ip, 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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, last_ip, 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, disqualified ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) RETURNING nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __last_ip_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)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __last_ip_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, __disqualified_val)
|
|
|
|
|
|
|
|
|
|
node = &Node{}
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __id_val, __address_val, __last_ip_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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __id_val, __address_val, __last_ip_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, __disqualified_val).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -5013,7 +5038,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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id.value())
|
|
|
|
@ -5022,7 +5047,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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -5067,7 +5092,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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id_greater_or_equal.value())
|
|
|
|
@ -5085,7 +5110,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.LastIp, &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)
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -6126,7 +6151,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.last_ip, 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 __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.last_ip, 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, nodes.disqualified")}}
|
|
|
|
|
|
|
|
|
|
__sets_sql := __sqlbundle_Literals{Join: ", "}
|
|
|
|
|
var __values []interface{}
|
|
|
|
@ -6252,6 +6277,11 @@ func (obj *postgresImpl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("contained = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if update.Disqualified._set {
|
|
|
|
|
__values = append(__values, update.Disqualified.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("disqualified = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __now)
|
|
|
|
@ -6266,7 +6296,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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
@ -7332,7 +7362,8 @@ func (obj *sqlite3Impl) Create_Node(ctx context.Context,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node_contained Node_Contained_Field,
|
|
|
|
|
node_disqualified Node_Disqualified_Field) (
|
|
|
|
|
node *Node, err error) {
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
@ -7363,13 +7394,14 @@ func (obj *sqlite3Impl) Create_Node(ctx context.Context,
|
|
|
|
|
__last_contact_success_val := node_last_contact_success.value()
|
|
|
|
|
__last_contact_failure_val := node_last_contact_failure.value()
|
|
|
|
|
__contained_val := node_contained.value()
|
|
|
|
|
__disqualified_val := node_disqualified.value()
|
|
|
|
|
|
|
|
|
|
var __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, last_ip, 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 __embed_stmt = __sqlbundle_Literal("INSERT INTO nodes ( id, address, last_ip, 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, disqualified ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )")
|
|
|
|
|
|
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __last_ip_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)
|
|
|
|
|
obj.logStmt(__stmt, __id_val, __address_val, __last_ip_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, __disqualified_val)
|
|
|
|
|
|
|
|
|
|
__res, err := obj.driver.Exec(__stmt, __id_val, __address_val, __last_ip_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, __last_ip_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, __disqualified_val)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -7946,7 +7978,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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified FROM nodes WHERE nodes.id = ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id.value())
|
|
|
|
@ -7955,7 +7987,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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, __values...).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -8000,7 +8032,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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified FROM nodes WHERE nodes.id >= ? ORDER BY nodes.id LIMIT ? OFFSET ?")
|
|
|
|
|
|
|
|
|
|
var __values []interface{}
|
|
|
|
|
__values = append(__values, node_id_greater_or_equal.value())
|
|
|
|
@ -8018,7 +8050,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.LastIp, &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)
|
|
|
|
|
err = __rows.Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -9215,6 +9247,11 @@ func (obj *sqlite3Impl) Update_Node_By_Id(ctx context.Context,
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("contained = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if update.Disqualified._set {
|
|
|
|
|
__values = append(__values, update.Disqualified.value())
|
|
|
|
|
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("disqualified = ?"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__now := obj.db.Hooks.Now().UTC()
|
|
|
|
|
|
|
|
|
|
__values = append(__values, __now)
|
|
|
|
@ -9234,12 +9271,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.last_ip, 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 __embed_stmt_get = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified 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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err == sql.ErrNoRows {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
@ -10056,13 +10093,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.last_ip, 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 __embed_stmt = __sqlbundle_Literal("SELECT nodes.id, nodes.address, nodes.last_ip, 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, nodes.disqualified 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.LastIp, &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)
|
|
|
|
|
err = obj.driver.QueryRow(__stmt, pk).Scan(&node.Id, &node.Address, &node.LastIp, &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, &node.Disqualified)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, obj.makeErr(err)
|
|
|
|
|
}
|
|
|
|
@ -10836,13 +10873,14 @@ func (rx *Rx) Create_Node(ctx context.Context,
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node_contained Node_Contained_Field,
|
|
|
|
|
node_disqualified Node_Disqualified_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_last_ip, 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)
|
|
|
|
|
return tx.Create_Node(ctx, node_id, node_address, node_last_ip, 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, node_disqualified)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -11663,7 +11701,8 @@ type Methods interface {
|
|
|
|
|
node_uptime_ratio Node_UptimeRatio_Field,
|
|
|
|
|
node_last_contact_success Node_LastContactSuccess_Field,
|
|
|
|
|
node_last_contact_failure Node_LastContactFailure_Field,
|
|
|
|
|
node_contained Node_Contained_Field) (
|
|
|
|
|
node_contained Node_Contained_Field,
|
|
|
|
|
node_disqualified Node_Disqualified_Field) (
|
|
|
|
|
node *Node, err error)
|
|
|
|
|
|
|
|
|
|
Create_Offer(ctx context.Context,
|
|
|
|
|