-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relational Metdata store with Prisma (#203)
* Added prisma schema * Fixed data sources API, modified METADATA_STORE client, TODOs: fix clients in all the code, fix all collections APIs * Completed datasources and collections api * Added data ingestion apis * Added delete ingestion runs in delete collection * Modified query controllers * Wrapped TF metadata store in agent executor loop to support for sync function * Added docker compose for prisma and postgress * Tfloader is optional available only when TFY_API_KEY is present, modified regex for collection and datasource in FE * import of PrismaStore only for Local environment * Added indexer support via UI * Symlinks and API, for localdir upload, WIP * Added feature to upload data to docker vol * Added delete datasource API for prisma * Added empty function for delete_data_source in Truefoundry * feat: upload to local directory integration in FE (#228) * feat: upload to local directory integration in FE * feat: add data source unlink button * feat: integrate delete data source api * fix: add VITE_USE_LOCAL in dockerfile * Fixed docker-compose for FE * Removed console logs * Updated compose.env
- Loading branch information
1 parent
7174901
commit 427b5e9
Showing
33 changed files
with
1,223 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ qdrant_storage/ | |
.truefoundry | ||
infinity/ | ||
volumes/ | ||
pgdata/ | ||
*.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ qdrant_db/ | |
*.pth | ||
.truefoundry | ||
volumes/ | ||
pgdata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-py" | ||
recursive_type_depth = 5 | ||
} | ||
|
||
model DataSource { | ||
id Int @id @default(autoincrement()) | ||
type String | ||
uri String @unique | ||
metadata Json? | ||
fqn String @unique | ||
@@map("data_sources") | ||
} | ||
|
||
model Collection { | ||
id Int @id @default(autoincrement()) | ||
name String @unique | ||
description String? | ||
embedder_config Json | ||
// Collection can have multiple data sources | ||
associated_data_sources Json? | ||
@@map("collections") | ||
} | ||
|
||
model IngestionRuns { | ||
id Int @id @default(autoincrement()) | ||
name String @unique | ||
collection_name String | ||
data_source_fqn String | ||
parser_config Json | ||
data_ingestion_mode String | ||
status String | ||
raise_error_on_failure Boolean | ||
errors Json? | ||
@@map("ingestion_runs") | ||
} | ||
|
||
enum Role { | ||
USER | ||
ADMIN | ||
} | ||
|
||
// From project root: | ||
// Validate: prisma validate --schema ./backend/database/schema.prisma | ||
|
||
// Generate Client: prisma generate --schema ./backend/database/schema.prisma | ||
|
||
// Push: prisma db push --schema ./backend/database/schema.prisma | ||
// The db push command also generates the client for you. If you want to generate the client without modifying your database, use the generate command. | ||
|
||
// It should be noted that whenever you make changes to your schema.prisma file you will have to re-generate the client, | ||
// you can do this automatically by running `prisma generate --schema ./backend/database/schema.prisma --watch` | ||
|
||
// Whenever you make changes to your model, migrate your database and re-generate your prisma code: | ||
// # apply migrations | ||
// prisma migrate dev --name "add comment model" | ||
// # generate | ||
// prisma generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.