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

feat: add abstract retention policy method define #36

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions opengemini_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,36 @@ def write_batch_points(self, database: str, batch_points: BatchPoints):
:return: return an error message
"""

@abstractmethod
def create_database(self, database: str, rp: RpConfig = None):
"""
create database
:param rp: RpConfig
:param database: name
"""

@abstractmethod
def show_databases(self) -> List[str]:
"""
show databases
:return: returns a databases list.
"""

@abstractmethod
def drop_database(self, database: str):
"""
drop database
:param database: name
"""

@abstractmethod
def create_retention_policy(self, dbname, rp_config: RpConfig, is_default: bool):
pass

@abstractmethod
def show_retention_policies(self, dbname):
pass

@abstractmethod
def drop_retention_policy(self, dbname, retention_policy: str):
pass
12 changes: 9 additions & 3 deletions opengemini_client/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,17 @@ def write_batch_points(self, database: str, batch_points: BatchPoints):
def create_database(self, database: str, rp: RpConfig = None):
pass

def create_database_with_rp(self, database: str, ):
pass

def show_databases(self) -> List[str]:
pass

def drop_database(self, database: str):
pass

def create_retention_policy(self, dbname, rp_config: RpConfig, is_default: bool):
pass

def show_retention_policies(self, dbname):
pass

def drop_retention_policy(self, dbname, retention_policy: str):
pass