feat(PostgreSQL): Get the PostgreSQL sequences

This commit is contained in:
Sylphy
2025-04-11 10:47:04 +08:00
parent d9779a4b2e
commit 557c43fede
12 changed files with 229 additions and 19 deletions

View File

@ -0,0 +1,50 @@
package ai.chat2db.server.domain.api.param;
import ai.chat2db.server.tools.base.wrapper.param.PageQueryParam;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
* Pagination query sequence information
*
* @author Sylphy
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SequencePageQueryParam extends PageQueryParam {
private static final long serialVersionUID = 1364512325486354343L;
/**
* Corresponding source id stored in the database
*/
@NotNull
private Long dataSourceId;
/**
* Corresponding connection database name
*/
@NotNull
private String databaseName;
/**
* Sequence Name
*/
private String sequenceName;
/**
* schema
*/
private String schemaName;
/**
* if true, refresh the cache
*/
private boolean refresh;
}

View File

@ -1,7 +1,10 @@
package ai.chat2db.server.domain.api.service;
import ai.chat2db.server.domain.api.param.SequencePageQueryParam;
import ai.chat2db.server.domain.api.param.ShowCreateSequenceParam;
import ai.chat2db.server.tools.base.wrapper.result.DataResult;
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
import ai.chat2db.spi.model.SimpleSequence;
/**
* Sequence source management services
@ -10,4 +13,6 @@ import ai.chat2db.server.tools.base.wrapper.result.DataResult;
*/
public interface SequenceService {
DataResult<String> showCreateSequence(ShowCreateSequenceParam request);
ListResult<SimpleSequence> pageQuery(SequencePageQueryParam request);
}