Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFeature/database as storage #989
Conversation
|
@ClayLambertExp This is a great option and thanks for implementing it! I think this sort of thing would have to be a plugin, though. Do you mind if we keep this PR open for a bit while we figure out if the plugin infrastructure has enough hooks to do this sort of thing? |
| * | ||
| * Author: Clay Lambert, additions by Ken Hawley | ||
| * */ | ||
| class DatabaseFilesystem(databaseContext: Postgres, maxDepth: Int = 4) extends NotebookFilesystem { |
Milyardo
Oct 23, 2020
This class should be final
This class should be final
@jeremyrsmith - Agree on the plugin based modular approach. Our team had same assessment. But wanted to leave to the community on how best to approach it. We'll be leaving the PR as is at this time, and have to move to other endeavors. Happy for you to keep the PR open for various contributors to align & time it with plugin hooks. |
| * */ | ||
| class DatabaseFilesystem(databaseContext: Postgres, maxDepth: Int = 4) extends NotebookFilesystem { | ||
|
|
||
| var dbContext: DbContext = null |
Milyardo
Oct 23, 2020
these should be private, also should probably be zio.Ref
these should be private, also should probably be zio.Ref
| * Returns the notebook content from the database wrapped in a Byte oriented stream. | ||
| * This makes a synchronous Quill call | ||
| */ | ||
| private def getNotebookContentStream(path: String): ByteArrayInputStream = { |
Milyardo
Oct 23, 2020
Should suspend the side effects here inside ZIO
Should suspend the side effects here inside ZIO
| /** | ||
| * Localized database access functions. Here is where the actual database calls are made. | ||
| */ | ||
| class Database(dbContext: DbContext) { |
Milyardo
Oct 23, 2020
If you suspend all of the database effects here in this class, you can ensure they're all captured in the filesystem.
If you suspend all of the database effects here in this class, you can ensure they're all captured in the filesystem.
Implementation on behalf of QOMPLX Inc, for providing database as a storage option for Polynote notebooks. All notebook CRUD operations operate against the database as if it were a file system. Thus all behavior matches that which is provided for File Systems. Whereby notebook data is stored in a database and may be shareable amongst multiple users.
This implementation is based on Postgres as the database store.