Skip to content
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 tables.list and tables.delete RPC APIs on the schema page #3651

Merged
merged 27 commits into from
Jul 25, 2024

Conversation

seancolsen
Copy link
Contributor

@seancolsen seancolsen commented Jul 3, 2024

This PR implements the following RPC methods on the schema page, making it possible to list tables, delete tables, and patch tables.

Endpoint HTTP Method Function
/api/db/v0/tables/ GET tables.list
/api/db/v0/tables/{tableId}/ DELETE tables.delete
/api/db/v0/tables/{tableId}/ PATCH tables.patch

I'll handle creating tables in a separate PR.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@seancolsen seancolsen added this to the Beta milestone Jul 3, 2024
@seancolsen seancolsen changed the title Implement RPC APIs on the schema page Implement tables RPC APIs on the schema page Jul 3, 2024
@seancolsen seancolsen force-pushed the tables_rpc_fe branch 2 times, most recently from fbd1c84 to 9beaa5e Compare July 8, 2024 01:01
Base automatically changed from schemas_rpc_fe to rpc_frontend July 9, 2024 14:08
@seancolsen seancolsen force-pushed the tables_rpc_fe branch 2 times, most recently from 36eb38b to fb85ec0 Compare July 11, 2024 15:20
Base automatically changed from beta to develop July 18, 2024 19:28
@seancolsen seancolsen changed the title Implement tables RPC APIs on the schema page Implement tables.list and tables.delete RPC APIs on the schema page Jul 19, 2024
@seancolsen seancolsen added the pr-status: review A PR awaiting review label Jul 19, 2024
@seancolsen seancolsen marked this pull request as ready for review July 19, 2024 18:46
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seancolsen I scanned through the code and it looks fine.

However, I'm not able to get tables to list on the UI while testing.

Screenshot:
Screenshot 2024-07-23 at 5 09 10 PM

Request:

{
  "jsonrpc":"2.0",
  "id":0,
  "method":"tables.list_with_metadata",
  "params": {
    "database_id":1,
    "schema_oid":2200
  }
}

Response:

{
    "id": 0,
    "jsonrpc": "2.0",
    "error": {
        "code": -31049,
        "message": "TypeError: 'NoneType' object is not iterable"
    }
}

I assume this is because I do not have any metadata and somewhere in the backend it's trying to read and merge a non-existent metadata.

@pavish pavish added pr-status: revision A PR awaiting follow-up work from its author after review and removed pr-status: review A PR awaiting review labels Jul 23, 2024
@pavish pavish assigned seancolsen and unassigned pavish Jul 23, 2024
@seancolsen
Copy link
Contributor Author

@pavish as far as I can tell, this is a backend bug. I've opened #3702 to fix it.

Can you re-test with a schema that contains tables?

I've tested with a schema that has tables, both with and without metadata, and it seems to work.

@seancolsen seancolsen assigned pavish and unassigned seancolsen Jul 24, 2024
@seancolsen seancolsen added pr-status: review A PR awaiting review and removed pr-status: revision A PR awaiting follow-up work from its author after review labels Jul 24, 2024
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seancolsen Looks good to me!

As discussed over call, we could merge this PR after resolving the conflicts here once #3710 is merged.

@seancolsen seancolsen removed the pr-status: review A PR awaiting review label Jul 25, 2024
@seancolsen seancolsen enabled auto-merge July 25, 2024 22:44
@seancolsen seancolsen added this pull request to the merge queue Jul 25, 2024
Merged via the queue into develop with commit 90eb9b4 Jul 25, 2024
33 checks passed
@seancolsen seancolsen deleted the tables_rpc_fe branch July 25, 2024 23:10
@kgodey kgodey modified the milestones: Beta, Pre-beta test build #1 Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants