module

Memo::SourceRegistry

Instance methods

create(db : DB::Database, source_type : String) : Int64

Create a source with no external ID (memo-managed)

Source
delete(db : DB::Database, source_type : String, external_id : ExternalId) : Bool

Delete a source record

Source
delete_by_id(db : DB::Database, internal_id : Int64) : Bool

Delete source by internal ID

Source
get_external(db : DB::Database, internal_id : Int64) : Tuple(String, ExternalId | Nil) | Nil

Get external ID and source_type from internal ID

Source
get_internal(db : DB::Database, source_type : String, external_id : ExternalId) : Int64 | Nil

Get internal ID for an external source (doesn't create)

Source
get_internal_any_type(db : DB::Database, external_id : ExternalId) : Int64 | Nil

Get internal ID without source_type filter

Source
list(db : DB::Database, source_type : String, limit : Int32 = 100, offset : Int32 = 0) : Array(Tuple(Int64, ExternalId | Nil))

List all sources for a given type

Source
resolve(db : DB::Database, source_type : String, external_id : ExternalId) : Int64

Resolve external ID to internal ID, creating source record if needed

Source