# Functions
AddParam adds single parameter to SQL statement.
CastInt function to check and cast interface{} to int data-type.
CastInt64 function to check and cast interface{} to int64 data-type.
CastString function to check and cast interface{} to string data-type.
CleanStatement cleans the given SQL statement to remove empty strings, etc.
ConvertFloat converts string representation of float scientific number to string int.
Date provides default date for DB records.
DecodeValidatorError provides uniform error representation of DBRecord validation errors.
helper function to create dbs error.
GetChunks helper function to get ORACLE chunks from provided list of values.
GetID function fetches table primary id for a given value.
GetRecID function fetches table primary id for a given value and insert it if necessary.
GetTestData executes simple query to ensure that connection to DB is valid.
HttpClient is HTTP client for urlfetch server.
IfExist check if given rid, attr exists in given table for provided value conditions.
IfExistMulti checks if given rid exists in given table for provided value conditions.
IncrementSequence API returns single unique ID for a given sequence.
IncrementSequences API provide a way to get N unique IDs for given sequence name.
LastInsertID returns last insert id of given table and idname parameter.
ListFiles lists files in a given directory.
LoadSQL function loads DBS SQL statements with Owner.
LoadTemplateSQL function loads DBS SQL templated statements.
OperatorValue function generates operator and value pair for a given argument.
ParseRuns parse run_num parameter and convert it to run list.
ParseTmpl parses template with given data.
PrintSQL prints SQL/args.
QueryRow function fetches results from given table.
ReplaceBinds replaces given pattern in string.
RunsConditions function to handle runs conditions.
TokenCondition provides proper condition statement for TokenGenerator.
TokenGenerator creates a SQL token generator statement.
TokenGeneratorORACLE creates a SQL token generator statement using ORACLE syntax https://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list.
TokenGeneratorSQLite creates a SQL token generator statement using SQLite syntax https://stackoverflow.com/questions/67372811/what-is-equivalent-of-token-generator-oracle-sql-statement-in-sqlite.
WhereClause function construct proper SQL statement from given statement and list of conditions.
# Constants
136 AcquisitionEra does not exist in DBS.
128 block xxx already exists in DBS.
106 db commit error.
117 content type error.
101 database error.
139 DatasetAccessType does not exist in DBS.
140 Dataset does not exist in DBS.
131 DatasetParent does not exist in DBS.
137 DataTier does not exist in DBS.
115 decode error.
116 encode error.
129 FileDataTypes does not exist in DBS.
130 FileParent does not exist in DBS.
generic DBS error.
109 get id db error.
124 HTTP request error.
110 db insert error.
127 invalid request error.
last available DBS error code.
112 db last insert error.
108 loading error, e.g.
123 marshal error.
125 Migration error.
119 not implemented API error.
118 parameters error.
107 parser error.
114 pattern error.
138 PhysicsGroup does not exist in DBS.
134 PrimaryDataset does not exist in DBS.
133 PrimaryDatasetType does not exist in DBS.
132 ProcessedDataset does not exist in DBS.
135 ProcessingEra does not exist in DBS.
103 query error.
120 io reader error.
126 remove error.
104 row scan error.
105 db session error.
102 transaction error.
122 json unmarshal error.
111 update error.
113 validation error.
121 io writer error.
# Variables
ConcurrencyErr represents generic concurrency error.
ConcurrentBulkBlocks defines if code should use concurrent bulkblocks API.
ContentTypeErr represents generic content-type error.
DatabaseErr represents generic database error.
DB represents sql DB pointer.
DBOWNER represents DBS DB owner.
DBSQL represents DBS SQL record.
DBTYPE represents DBS DB type, e.g.
DRYRUN allows to skip query execution and printout DB statements along with passed parameters.
FileLumiChunkSize controls chunk size for FileLumi list insertion.
FileLumiInsertMethod controls which method to use for insertion of FileLumi list.
FileLumiMaxSize controls max size for FileLumi list insertion.
GenericErr represents generic dbs error.
InvalidParamErr represents generic error for invalid input parameter.
InvalidRequestErr represents generic invalid request error.
NotImplementedApiErr represents generic not implemented api error.
RecordErr represents generic record error.
RecordValidator pointer to validator Validate method.
StaticDir provides location of static directory.
Timeout represents DBS timeout used by HttpClient.
ValidationErr represents generic validation error.
Verbose controls verbosity level.
# Structs
API structure represents DBS API.
Buckets represents Buckets DBS DB table.
DatasetRecord represents input dataset record from HTTP request.
Datasets represents Datasets DBS DB table.
DBSError represents common structure for DBS errors.
FileRecord represents input file record from HTTP request.
Files represents Files DBS DB table.
ParentRecord represents input parent record from HTTP request.
Parents represents Parents DBS DB table.
Processing represents Processing DBS DB table.
Sites represents Sites DBS DB table.
# Interfaces
DBRecord interface represents general DB record used by DBS APIs.