Remove unused sequences code

This commit is contained in:
Dan Sosedoff 2016-01-12 22:05:32 -06:00
parent fbaa61bbbc
commit 556e7d445a
7 changed files with 2 additions and 39 deletions

View File

@ -233,11 +233,6 @@ func GetConnectionInfo(c *gin.Context) {
c.JSON(200, res.Format()[0]) 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) { func GetActivity(c *gin.Context) {
res, err := DB(c).Activity() res, err := DB(c).Activity()
serveResult(res, err, c) serveResult(res, err, c)

View File

@ -29,7 +29,6 @@ func SetupRoutes(router *gin.Engine) {
api.POST("/connect", Connect) api.POST("/connect", Connect)
api.GET("/databases", GetDatabases) api.GET("/databases", GetDatabases)
api.GET("/connection", GetConnectionInfo) api.GET("/connection", GetConnectionInfo)
api.GET("/sequences", GetSequences)
api.GET("/activity", GetActivity) api.GET("/activity", GetActivity)
api.GET("/schemas", GetSchemas) api.GET("/schemas", GetSchemas)
api.GET("/objects", GetObjects) api.GET("/objects", GetObjects)

View File

@ -171,10 +171,6 @@ func (client *Client) TableConstraints(table string) (*Result, error) {
return res, err return res, err
} }
func (client *Client) Sequences() ([]string, error) {
return client.fetchRows(statements.PG_SEQUENCES)
}
// Returns all active queriers on the server // Returns all active queriers on the server
func (client *Client) Activity() (*Result, error) { func (client *Client) Activity() (*Result, error) {
return client.query(statements.PG_ACTIVITY) return client.query(statements.PG_ACTIVITY)

View File

@ -207,20 +207,6 @@ func test_TableConstraints(t *testing.T) {
assert.Equal(t, 2, len(res.Rows)) 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) { func test_Query(t *testing.T) {
res, err := testClient.Query("SELECT * FROM books") res, err := testClient.Query("SELECT * FROM books")
@ -301,7 +287,6 @@ func TestAll(t *testing.T) {
test_TableInfo(t) test_TableInfo(t)
test_TableIndexes(t) test_TableIndexes(t)
test_TableConstraints(t) test_TableConstraints(t)
test_Sequences(t)
test_Query(t) test_Query(t)
test_QueryError(t) test_QueryError(t)
test_QueryInvalidTable(t) test_QueryInvalidTable(t)

File diff suppressed because one or more lines are too long

View File

@ -92,17 +92,6 @@ WHERE
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
PG_SEQUENCES = `
SELECT
sequence_name
FROM
information_schema.sequences
WHERE
sequence_schema = 'public'
ORDER BY sequence_name`
// ---------------------------------------------------------------------------
PG_ACTIVITY = ` PG_ACTIVITY = `
SELECT SELECT
datname, datname,

View File

@ -84,7 +84,6 @@ function getTableIndexes(table, cb) { apiCall("get", "/tables/" + table + "/
function getTableConstraints(table, cb) { apiCall("get", "/tables/" + table + "/constraints", {}, cb); } function getTableConstraints(table, cb) { apiCall("get", "/tables/" + table + "/constraints", {}, cb); }
function getHistory(cb) { apiCall("get", "/history", {}, cb); } function getHistory(cb) { apiCall("get", "/history", {}, cb); }
function getBookmarks(cb) { apiCall("get", "/bookmarks", {}, 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 executeQuery(query, cb) { apiCall("post", "/query", { query: query }, cb); }
function explainQuery(query, cb) { apiCall("post", "/explain", { query: query }, cb); } function explainQuery(query, cb) { apiCall("post", "/explain", { query: query }, cb); }