Skip to content

[python] Introduce database related commands to Python CLI#7362

Merged
JingsongLi merged 5 commits intoapache:masterfrom
JingsongLi:db_cli
Mar 8, 2026
Merged

[python] Introduce database related commands to Python CLI#7362
JingsongLi merged 5 commits intoapache:masterfrom
JingsongLi:db_cli

Conversation

@JingsongLi
Copy link
Contributor

@JingsongLi JingsongLi commented Mar 8, 2026

Purpose

This PR adds database-related CLI commands to the PyPaimon command-line interface, extending the existing table commands with a new db command group.

  • db get — Display database info as JSON
  • db create — Create a database with optional properties and --ignore-if-exists
  • db drop — Drop a database with --ignore-if-not-exists and --cascade
  • db alter — Alter database properties via --set (JSON) and --remove (key list)
  • db list-tables — List all tables in a database
  • table rename — Rename a table in the catalog

Tests

API and Format

Documentation

Generative AI tooling

Claude-4.6

# See the License for the specific language governing permissions and
# limitations under the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
Copy link
Member

Choose a reason for hiding this comment

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

have duplicated license headers

# See the License for the specific language governing permissions and
# limitations under the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
Copy link
Member

Choose a reason for hiding this comment

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

the same duplicated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

"""Create a database with properties."""

@abstractmethod
def drop_database(self, name: str, ignore_if_not_exists: bool = False, cascade: bool = False):
Copy link
Member

Choose a reason for hiding this comment

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

RESTCatalog still implements the old two-argument signature, maybe it will fail at runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed~

@plusplusjiajia
Copy link
Member

+1

@JingsongLi JingsongLi merged commit 8176dde into apache:master Mar 8, 2026
6 checks passed
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.

2 participants