mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-03 06:17:03 +08:00
support function trigger view
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
package ai.chat2db.server.domain.api.service;
|
||||
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Function;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* author jipengfei
|
||||
* date 2021/9/23 15:22
|
||||
*/
|
||||
public interface FunctionService {
|
||||
|
||||
/**
|
||||
* Querying all functions under a schema.
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
ListResult<Function> functions(@NotEmpty String databaseName, String schemaName);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package ai.chat2db.server.domain.api.service;
|
||||
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Procedure;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
public interface ProcedureService {
|
||||
|
||||
/**
|
||||
* Querying all procedures under a schema.
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
ListResult<Procedure> procedures(@NotEmpty String databaseName, String schemaName);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package ai.chat2db.server.domain.api.service;
|
||||
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Trigger;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
public interface TriggerService {
|
||||
|
||||
/**
|
||||
* Querying all triggers under a schema.
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
ListResult<Trigger> triggers(@NotEmpty String databaseName, String schemaName);
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package ai.chat2db.server.domain.api.service;
|
||||
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Table;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* author jipengfei
|
||||
* date 2021/9/23 15:22
|
||||
*/
|
||||
public interface ViewService {
|
||||
|
||||
/**
|
||||
* Querying all views under a schema.
|
||||
*
|
||||
* @param databaseName
|
||||
* @return
|
||||
*/
|
||||
ListResult<Table> views(@NotEmpty String databaseName, String schemaName);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package ai.chat2db.server.domain.core.impl;
|
||||
|
||||
import ai.chat2db.server.domain.api.service.FunctionService;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Function;
|
||||
import ai.chat2db.spi.sql.Chat2DBContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class FunctionServiceImpl implements FunctionService {
|
||||
@Override
|
||||
public ListResult<Function> functions(String databaseName, String schemaName) {
|
||||
return ListResult.of(Chat2DBContext.getMetaData().functions(databaseName, schemaName));
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package ai.chat2db.server.domain.core.impl;
|
||||
|
||||
import ai.chat2db.server.domain.api.service.ProcedureService;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Procedure;
|
||||
import ai.chat2db.spi.sql.Chat2DBContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ProcedureServiceImpl implements ProcedureService {
|
||||
|
||||
@Override
|
||||
public ListResult<Procedure> procedures(String databaseName, String schemaName) {
|
||||
return ListResult.of(Chat2DBContext.getMetaData().procedures(databaseName, schemaName));
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package ai.chat2db.server.domain.core.impl;
|
||||
|
||||
import ai.chat2db.server.domain.api.service.TriggerService;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Trigger;
|
||||
import ai.chat2db.spi.sql.Chat2DBContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TriggerServiceImpl implements TriggerService {
|
||||
@Override
|
||||
public ListResult<Trigger> triggers(String databaseName, String schemaName) {
|
||||
return ListResult.of(Chat2DBContext.getMetaData().triggers(databaseName, schemaName));
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package ai.chat2db.server.domain.core.impl;
|
||||
|
||||
import ai.chat2db.server.domain.api.service.ViewService;
|
||||
import ai.chat2db.server.tools.base.wrapper.result.ListResult;
|
||||
import ai.chat2db.spi.model.Table;
|
||||
import ai.chat2db.spi.sql.Chat2DBContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ViewServiceImpl implements ViewService {
|
||||
|
||||
@Override
|
||||
public ListResult<Table> views(String databaseName, String schemaName) {
|
||||
return ListResult.of(Chat2DBContext.getMetaData().views(databaseName, schemaName));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user