-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement listProjects method for MapeoManager class #208
Conversation
71fc1d9
to
f1d8bf8
Compare
7eb7825
to
aa29820
Compare
aa29820
to
e6d6f4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hate to be that person, but I think this entire PR can be done in one line:
async listProjects() {
return this.#db.select().from(projectTable).all()
}
(might actually need a little bit more).
Keeping the project table in the client instance was so that we can do this.
/** | ||
* @returns {Promise<Array<ProjectInfo & Pick<ProjectValue, 'name'>>>} | ||
*/ | ||
async listProjects() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the shenanigans about having a shared index writer were so that we did not have to create project instances to get the project name, and instead we can do:
this.#db.select().from(projectTable).all()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed via b29fa8b
@gmaclennan ah right, forgot about the projects table 🤦♂️ |
f4d60c5
to
634b8c3
Compare
e6d6f4f
to
7b889a8
Compare
7b889a8
to
4e662ae
Compare
src/mapeo-manager.js
Outdated
}) | ||
.from(projectTable) | ||
.all() | ||
.map((value) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mapbyr use the denullify function here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed via 5ff8aad
Looks good to me 👍 |
* main: (25 commits) add initial implementation of MemberApi (#232) feat: $blobs.getUrl and $blobs.create methods (#184) chore: update manager e2e tests (#237) feat: add capabilities (#231) feat: coreOwnership integration [3/3] (#230) feat: CoreOwnership class w getOwner & getCoreKey [2/3] (#229) feat: handle `coreOwnership` records in `IndexWriter` [1/3] (#214) fix: adjust storage options for MapeoManager and MapeoProject (#235) implement addProject method for MapeoManager class (#215) implement listProjects method for MapeoManager class (#208) feat: expose blobStore.writerDriveId (#219) implement wrapper client containing createProject and getProject methods (#199) add project settings functionality to MapeoProject (#187) feat: Add encode/decode for project keys [3/3] (#203) feat: update protobuf for RPC [2/3] (#202) chore: move protobuf messages into src/generated [1/3] (#201) feat: Add internal `dataType.createWithDocId()` (#192) chore: explicitly set "mode" opt for encryptionKeys column creation (#186) chore: fix linting and type checking (#183) chore: consolidate encryption key columns in projectKeys table (#181) ...
Closes #206
NOTE: Stacked on #199Also:
adds aEDIT: No longer relevant$getProjectInfo
to theMapeoProject
class, which is used to retrieve information that's used for the resultingMapeoManager.listProjects()
return value.$getProjectInfo
returns theProjectInfo
type, which represents meta information about a project (different from its settings). It is currently defined as