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.
db-src
- Manage Database SourcesThe db-src
command allows you to specify and manage your database sources, such as MySQL, SQL Server, and MongoDB.
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.db-src add "MyMongoDB" "mongodb://username:password©host:port"
db-query
- Write and Run Database QueriesThe db-query
command allows you to create, edit, list, and run queries on the specified database sources.
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.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.
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
db-report
- Schedule and Manage Database ReportsThe 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.
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.-u --username "the-username"
: Filter reports by a specific username.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
Here’s a simple workflow demonstrating how to use these commands together:
db-src add "MySQLDB" "server=mysql.myserver.com;user=demoUser;database=myDb;password=password123"
db-query new
# Enter the query name: GetAllCustomers
# Enter the database source: MySQLDB
# Enter the query: SELECT * FROM customers
db-query run GetAllCustomers
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
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.