handler

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package handler provides HTTP request handlers for interacting with SQL databases and managing database connections, queries, and operations.

It includes various functionalities for:

  • Establishing and managing database connections.
  • Executing SQL queries and handling query results.
  • Retrieving database schema information.
  • Performing database operations such as dropping tables, truncating tables, dropping databases, and creating databases.
  • Exporting table data to JSON and CSV formats.
  • Handling HTTP request/response for database-related tasks.

This package is designed to work with SQL databases through a RESTful API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() *Handler

func (*Handler) ConnectHandler

func (h *Handler) ConnectHandler() http.HandlerFunc

func (*Handler) CountTableColumnsHandler

func (h *Handler) CountTableColumnsHandler() http.HandlerFunc

func (*Handler) CountTableRowsHandler

func (h *Handler) CountTableRowsHandler() http.HandlerFunc

func (*Handler) CreateDatabaseHandler

func (h *Handler) CreateDatabaseHandler() http.HandlerFunc

func (*Handler) DbDisconnect

func (h *Handler) DbDisconnect() http.HandlerFunc

func (*Handler) DropDatabaseHandler

func (h *Handler) DropDatabaseHandler() http.HandlerFunc

func (*Handler) DropTableHandler

func (h *Handler) DropTableHandler() http.HandlerFunc

func (*Handler) ExportTableToCSV

func (h *Handler) ExportTableToCSV() http.HandlerFunc

func (*Handler) ExportTableToJson

func (h *Handler) ExportTableToJson() http.HandlerFunc

func (*Handler) GetColumnData

func (h *Handler) GetColumnData() http.HandlerFunc

func (*Handler) GetDB

func (h *Handler) GetDB() *sql.DB

func (*Handler) QueryHandler

func (h *Handler) QueryHandler() http.HandlerFunc

func (*Handler) SaveConnection

func (h *Handler) SaveConnection() http.HandlerFunc

func (*Handler) SavedConnectionsHandler

func (h *Handler) SavedConnectionsHandler() http.HandlerFunc

func (*Handler) ShowConnectedClient

func (h *Handler) ShowConnectedClient(writer http.ResponseWriter)

func (*Handler) ShowCreateTable

func (h *Handler) ShowCreateTable() http.HandlerFunc

func (*Handler) ShowSchemas

func (h *Handler) ShowSchemas() http.HandlerFunc

func (*Handler) ShowTablesHandler

func (h *Handler) ShowTablesHandler() http.HandlerFunc

func (*Handler) TableDataHandler

func (h *Handler) TableDataHandler() http.HandlerFunc

func (*Handler) TableSizeHandler

func (h *Handler) TableSizeHandler() http.HandlerFunc

func (*Handler) TableSizesHandler

func (h *Handler) TableSizesHandler() http.HandlerFunc

func (*Handler) TruncateTableHandler

func (h *Handler) TruncateTableHandler() http.HandlerFunc

func (*Handler) UpdateRowHandler

func (h *Handler) UpdateRowHandler() http.HandlerFunc

type Response

type Response struct {
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

Response represents a standard response structure for API responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL