Remove unused sequences code
This commit is contained in:
parent
fbaa61bbbc
commit
556e7d445a
@ -233,11 +233,6 @@ func GetConnectionInfo(c *gin.Context) {
|
||||
c.JSON(200, res.Format()[0])
|
||||
}
|
||||
|
||||
func GetSequences(c *gin.Context) {
|
||||
res, err := DB(c).Sequences()
|
||||
serveResult(res, err, c)
|
||||
}
|
||||
|
||||
func GetActivity(c *gin.Context) {
|
||||
res, err := DB(c).Activity()
|
||||
serveResult(res, err, c)
|
||||
|
@ -29,7 +29,6 @@ func SetupRoutes(router *gin.Engine) {
|
||||
api.POST("/connect", Connect)
|
||||
api.GET("/databases", GetDatabases)
|
||||
api.GET("/connection", GetConnectionInfo)
|
||||
api.GET("/sequences", GetSequences)
|
||||
api.GET("/activity", GetActivity)
|
||||
api.GET("/schemas", GetSchemas)
|
||||
api.GET("/objects", GetObjects)
|
||||
|
@ -171,10 +171,6 @@ func (client *Client) TableConstraints(table string) (*Result, error) {
|
||||
return res, err
|
||||
}
|
||||
|
||||
func (client *Client) Sequences() ([]string, error) {
|
||||
return client.fetchRows(statements.PG_SEQUENCES)
|
||||
}
|
||||
|
||||
// Returns all active queriers on the server
|
||||
func (client *Client) Activity() (*Result, error) {
|
||||
return client.query(statements.PG_ACTIVITY)
|
||||
|
@ -207,20 +207,6 @@ func test_TableConstraints(t *testing.T) {
|
||||
assert.Equal(t, 2, len(res.Rows))
|
||||
}
|
||||
|
||||
func test_Sequences(t *testing.T) {
|
||||
res, err := testClient.Sequences()
|
||||
|
||||
expected := []string{
|
||||
"author_ids",
|
||||
"book_ids",
|
||||
"shipments_ship_id_seq",
|
||||
"subject_ids",
|
||||
}
|
||||
|
||||
assert.Equal(t, nil, err)
|
||||
assert.Equal(t, expected, res)
|
||||
}
|
||||
|
||||
func test_Query(t *testing.T) {
|
||||
res, err := testClient.Query("SELECT * FROM books")
|
||||
|
||||
@ -301,7 +287,6 @@ func TestAll(t *testing.T) {
|
||||
test_TableInfo(t)
|
||||
test_TableIndexes(t)
|
||||
test_TableConstraints(t)
|
||||
test_Sequences(t)
|
||||
test_Query(t)
|
||||
test_QueryError(t)
|
||||
test_QueryInvalidTable(t)
|
||||
|
File diff suppressed because one or more lines are too long
@ -92,17 +92,6 @@ WHERE
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
PG_SEQUENCES = `
|
||||
SELECT
|
||||
sequence_name
|
||||
FROM
|
||||
information_schema.sequences
|
||||
WHERE
|
||||
sequence_schema = 'public'
|
||||
ORDER BY sequence_name`
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
PG_ACTIVITY = `
|
||||
SELECT
|
||||
datname,
|
||||
|
@ -84,7 +84,6 @@ function getTableIndexes(table, cb) { apiCall("get", "/tables/" + table + "/
|
||||
function getTableConstraints(table, cb) { apiCall("get", "/tables/" + table + "/constraints", {}, cb); }
|
||||
function getHistory(cb) { apiCall("get", "/history", {}, cb); }
|
||||
function getBookmarks(cb) { apiCall("get", "/bookmarks", {}, cb); }
|
||||
function getSequences(cb) { apiCall("get", "/sequences", {}, cb); }
|
||||
function executeQuery(query, cb) { apiCall("post", "/query", { query: query }, cb); }
|
||||
function explainQuery(query, cb) { apiCall("post", "/explain", { query: query }, cb); }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user