Skip to content

init

DB repository part of Repository pattern for parsed github files.

Note: Two uses of repository here. GitHub 'repository' and 'repository' pattern.

This part is about the repository pattern part of dealing with github repositories.

__all__ = ['AbstractParsedGithubFileRepository', 'ParsedCodeFileID', 'ParsedFileID', 'ParsedTextFileID', 'SQLParsedGithubFileRepository', 'file_id_from_any_schema'] module-attribute

AbstractParsedGithubFileRepository

Bases: RepositoryBase[ParsedGithubFile, ParsedFileID], ABC

UID = ParsedFileID class-attribute instance-attribute

code_file_repo instance-attribute

general_text_chunk_repo instance-attribute

create_many(schemas) async

Create many new entries in the database.

I.e., each schema represents a completely new file that has been parsed and needs to be stored in the database for the first time.

Note: This does not implement, only a starting check for subclasses to start from.

delete_many(unique_ids) async

Delete many entries from the database.

list_by_metadatas(gh_metadatas, fully_load=False) async

list_by_repo(repo_id, fully_load=False) async

update_file_metadata(file, new_path=None) async

Special method to update the GithubMetadata.

Note: Have to use special method because GitHub Metadata is otherwise used for locating files in the database.

update_many(schemas) async

Update many entries in the database.

I.e., each schema represents a file that has been parsed and needs to be updated in the database.

Note: This does not implement, only a starting check for subclasses to start from.

ParsedCodeFileID

Bases: ParsedFileID

ParsedFileID

Bases: UniqueIDBase[ParsedGithubFile], ABC

branch instance-attribute

node_id instance-attribute

owner instance-attribute

path instance-attribute

repo instance-attribute

equal_excluding_version_and_deletion(other)

from_schema(schema, exact_version=False) classmethod

ParsedTextFileID

Bases: ParsedFileID

SQLParsedGithubFileRepository

Bases: SQLRepositoryMixin, AbstractParsedGithubFileRepository

code_file_repo = SQLCodeFileRepository(session) instance-attribute

general_text_chunk_repo = SQLTextFileRepository(session) instance-attribute

__init__(session)

file_id_from_any_schema(schema, exact_version=False)