SealEye Database Commands Guide

SealEye introduces a set of powerful new commands designed to provide a lightweight and efficient way to manage database sources, run queries, and generate periodic reports. These commands allow users to specify database sources, execute queries, and set up scheduled reports, making it a lightweight web-based alternative to SQL Server Reporting Services (SSRS). Here’s how you can make the most out of these features.

Command Overview

  1. db-src: Manage database sources.
  2. db-query: Write and run database queries.
  3. db-report: Schedule and manage database reports.

1. db-src - Manage Database Sources

The db-src command allows you to specify and manage your database sources, such as MySQL, SQL Server, and MongoDB.

Commands:

  • db-src list: List all configured database sources.
  • db-src delete <number>: Delete a database source by its number.
  • db-src add "name" "connection string": Add a new database source with a specified name and connection string.

Example:

db-src add "MyMongoDB" "mongodb://username:password©host:port"

2. db-query - Write and Run Database Queries

The db-query command allows you to create, edit, list, and run queries on the specified database sources.

Commands:

  • db-query list: List all saved queries.
  • db-query new: Open a form to create a new query.
  • db-query edit <name>: Open a form to edit an existing query by name.
  • db-query run <name>: Run a specified query by name.

MongoDB Specifics:

For MongoDB sources, only db.collection.find and db.collection.count queries are supported. Regex within queries and JavaScript code (e.g., new Date()) are not supported.

Example:

Creating and running a MongoDB query:

db-query new
    # Enter the query name: FindAllUsers
    # Enter the database source: MyMongoDB
    # Enter the query: db.users.find({})
db-query run FindAllUsers

3. db-report - Schedule and Manage Database Reports

The db-report command allows you to create and manage reports that consist of one or more database queries and schedule them to run at specified intervals. Reports can be shared with other users or kept private.

Commands:

  • db-report list: List all scheduled reports.
  • db-report new: Open a form to create a new report.
  • db-report edit <name>: Open a form to edit an existing report by name.
  • db-report view <name>: View the latest run of a specified report by name.

Options:

  • -u --username "the-username": Filter reports by a specific username.

Example:

Creating and scheduling a report:

db-report new
    # Enter the report name: DailyUserReport
    # Enter the queries to include: FindAllUsers, CountUsers
    # Enter the schedule (minute/hour/day/month): day
    # Enter the visibility (private|specific users|public): public

Comparison to SQL Server Reporting Services (SSRS)


Pain Points of SSRS:

  1. Cost:
    • High Licensing Fees: SSRS requires expensive licensing fees, which can be prohibitive for small to medium-sized businesses.
    • Infrastructure Costs: Hosting SSRS requires dedicated infrastructure, leading to additional costs for hardware and maintenance.
  2. Complexity:
    • Steep Learning Curve: SSRS has a complex setup and configuration process, making it difficult for non-expert users to get started.
    • Advanced Skills Required: Users need to be proficient in SQL and reporting services, often necessitating specialized training.
  3. Self-Hosted:
    • Maintenance Burden: SSRS must be self-hosted, meaning users need to manage servers, backups, and updates.
    • Scalability Issues: Scaling SSRS for increased usage can be challenging and resource-intensive.

How SealEye Addresses These Pain Points:

  1. Cost:
    • Free to Use: SealEye provides these features without expensive licensing fees.
    • No Infrastructure Required: Being a web-based platform, SealEye eliminates the need for dedicated infrastructure and maintenance costs.
  2. Simplicity:
    • Easy Setup: SealEye’s command-line interface is straightforward, allowing users to quickly set up and run queries without extensive configuration.
    • User-Friendly: Designed for tech enthusiasts and professionals, SealEye simplifies the process of managing database interactions through intuitive commands.
  3. Web-Based and Managed:
    • No Maintenance Required: As a web-based service, SealEye handles all server management, backups, and updates, freeing users from these tasks.
    • Easily Scalable: SealEye’s infrastructure is designed to scale seamlessly with user demand, ensuring consistent performance.

Example Workflow

Here’s a simple workflow demonstrating how to use these commands together:

1. Add a Database Source:

db-src add "MySQLDB" "server=mysql.myserver.com;user=demoUser;database=myDb;password=password123"

2. Create a New Query:

db-query new
    # Enter the query name: GetAllCustomers
    # Enter the database source: MySQLDB
    # Enter the query: SELECT * FROM customers

3. Run the Query:

db-query run GetAllCustomers

4. Create and Schedule a Report:

db-report new
    # Enter the report name: WeeklyCustomerReport
    # Enter the queries to include: GetAllCustomers
    # Enter the schedule (minute/hour/day/month): week
    # Enter the visibility (private|specific users|public): public

Future Enhancements

Currently, the queries do not accept parameters, but this functionality may be added in the future to accommodate custom parameters, making the tool even more flexible and powerful.

By using these commands, SealEye users can efficiently manage their database interactions, run queries, and share reports directly from the CLI. SealEye thus offers a powerful and lightweight alternative to SSRS, addressing key pain points like cost, complexity, and the burden of self-hosting.

Type todo to view your outstanding todos (2 currently).

(anonymous)