class ShardsDB

Defined in:

db.cr

Constant Summary

JOBS_CHANNEL = "jobs"

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(connection : DB::Connection) #

[View source]

Class Method Detail

def self.application_name : String | Nil #

[View source]
def self.application_name=(application_name : String | Nil) #

[View source]
def self.connect(&) #

[View source]
def self.database_url : String #

[View source]
def self.database_url=(database_url : String) #

[View source]
def self.db #

[View source]
def self.listen_for_jobs(&block : PQ::Notification -> ) #

[View source]
def self.statement_timeout : String | Nil #

[View source]
def self.statement_timeout=(statement_timeout : String | Nil) #

[View source]
def self.transaction(&) #

[View source]

Instance Method Detail

def all_categories #

[View source]
def all_releases(shard_id : Int64) #

[View source]
def connection : DB::Connection #

[View source]
def create_category(category : Category) #

[View source]
def create_owner(owner : Repo::Owner) #

[View source]
def create_release(shard_id : Int64, release : Release, position : Int | Nil = nil) #

[View source]
def create_repo(repo : Repo) #

[View source]
def create_shard(shard : Shard) #

[View source]
def delete_categorizations(repo_refs : Array(Repo::Ref)) #

[View source]
def delete_file(release_id, path) #

[View source]
def fetch_file(release_id, path) #

[View source]
def find_canonical_ref?(shard_id) #

[View source]
def find_canonical_repo(shard_id : Int64) #

[View source]
def find_mirror_repos(shard_id : Int64) #

[View source]
def get_owned_repos(owner_id : Int64) #

[View source]
def get_owner?(resolver : String, slug : String) #

[View source]
def get_owner?(repo_ref : Repo::Ref) #

[View source]
def get_repo(repo_id : Int64) #

[View source]
def get_repo(repo_ref : Repo::Ref) #

[View source]
def get_repo?(repo_ref : Repo::Ref) #

[View source]
def get_repo_id(resolver : String, url : String) #

[View source]
def get_repo_id(repo_ref : Repo::Ref) #

[View source]
def get_repo_id?(resolver : String, url : String) #

[View source]
def get_repo_id?(repo_ref : Repo::Ref) #

[View source]
def get_shard(shard_id : Int64) #

[View source]
def get_shard_id(name : String, qualifier : String = "") #

[View source]
def get_shard_id?(name : String, qualifier : Nil) #

[View source]
def get_shard_id?(name : String, qualifier : String = "") #

[View source]
def get_shards #

[View source]
def last_activities #

[View source]
def last_catalog_import : Time | Nil #

[View source]
def last_metrics_calc : Time | Nil #

[View source]
def last_repo_sync : Time | Nil #

[View source]
def log_activity(event : String, repo_id : Int64 | Nil = nil, shard_id : Int64 | Nil = nil, metadata = nil, exc = nil) #

LOGGING


[View source]
def put_file(release_id, path, content) #

[View source]
def remove_category(slug : String) #

[View source]
def repo_sync_failed(repo) #

[View source]
def repos_pending_sync #

[View source]
def send_job_notification(message) #

[View source]
def set_owner(repo_ref : Repo::Ref, owner_id : Int64) #

[View source]
def shards_in_category(category_id : Int64 | Nil) #

[View source]
def sql_array(array) #

[View source]
def update_categorization(repo_ref : Repo::Ref, categories : Array(String)) #

[View source]
def update_categorization(shard_id : Int64, categories : Array(String)) #

[View source]
def update_category(category : Category) #

[View source]
def update_owner_shards_count(owner_id : Int64) #

[View source]
def update_release(release : Release) #

[View source]
def upsert_dependency(release_id : Int64, dependency : Dependency, repo_id = nil) #

[View source]