Skip to content

kerem-kaynak/querysight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuerySight

QuerySight is a lightweight, zero-config query monitoring tool for Go database applications. It provides real-time visibility into your database queries with minimal code changes.

Features

  • Real-time query monitoring
  • Works with any database supported by database/sql
  • Zero configuration required
  • Minimal code changes (just one line in most cases)
  • Web UI for visualizing query performance
  • Support for popular libraries (GORM, sqlx, etc.)

Installation

go get github.com/kerem-kaynak/querysight

Usage

Basic Usage with database/sql

import (
    "github.com/yourusername/querysight"
    _ "github.com/lib/pq" // PostgreSQL driver
)

func main() {
    // Replace sql.Open with querysight.Open - just one line change!
    db, err := querysight.Open("postgres", "postgres://user:pass@localhost/dbname")
    if err != nil {
        log.Fatal(err)
    }

    // Use db as you normally would - all queries will be monitored
    rows, err := db.Query("SELECT * FROM users")
    // ...
}

With GORM

import (
    "github.com/yourusername/querysight"
    "gorm.io/gorm"
)

func main() {
    // One-step initialization
    gormDB, _, err := querysight.OpenGORMPostgres("postgres://user:pass@localhost/dbname", nil)
    if err != nil {
        log.Fatal(err)
    }

    // Use GORM as normal - all queries will be monitored
    var users []User
    gormDB.Find(&users)
}

With sqlx

import (
    "github.com/yourusername/querysight"
)

func main() {
    // One-step initialization
    sqlxDB, _, err := querysight.OpenSQLXPostgres("postgres://user:pass@localhost/dbname")

About

Trace, analyze and debug database queries in local Go applications with a beautiful UI. In just one line.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors