Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ temp/
# yarn.lock
# pnpm-lock.yaml
# or if you use specific test result files
# coverage/
coverage/
# test-results/
23 changes: 23 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# QueryLeaf Development Guide

## Build & Test Commands
- Full build: `yarn build`
- Typecheck: `yarn typecheck`
- Lint: `yarn lint` (fix: `yarn lint:fix`)
- Format: `yarn format` (check: `yarn format:check`)
- Run all tests: `yarn test`
- Run individual package tests: `yarn test:lib`, `yarn test:cli`, `yarn test:server`, `yarn test:pg-server`
- Run single test: `cd packages/[package] && npx jest -t "test name"` or `npx jest path/to/test.test.ts -t "test name"`
- Integration tests: `yarn test:lib:integration` (requires Docker)
- Documentation: `yarn docs:serve` (dev), `yarn docs:build` (build)

## Code Style Guidelines
- TypeScript with strict typing; avoid `any` when possible
- Single quotes, trailing commas, 2-space indentation, 100 char line limit
- Prefix unused variables with underscore (e.g., `_unused`)
- Monorepo structure with packages: lib, cli, server, postgres-server
- Descriptive variable/function names in camelCase
- Error handling with proper try/catch blocks and meaningful error messages
- Use async/await for asynchronous code
- Follow existing patterns for similar functionality
- Tests should cover both unit and integration cases
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ QueryLeaf is a library that translates SQL queries into MongoDB commands. It par
- Array element access (e.g., `items[0].name`)
- GROUP BY with aggregation functions (COUNT, SUM, AVG, MIN, MAX)
- JOINs between collections
- Multiple interfaces:
- Library for direct integration in your code
- CLI for command-line SQL queries
- Web Server for REST API access
- **PostgreSQL Wire Protocol Server** for connecting with standard PostgreSQL clients

## SQL to MongoDB Translation Examples

Expand Down
55 changes: 53 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ db.collection('users').aggregate([
<div class="use-cases-section">
<div class="container">
<div class="section-title">
<h2>Three Ways to Use QueryLeaf</h2>
<h2>Four Ways to Use QueryLeaf</h2>
<p>Choose the right option for your workflow</p>
</div>

Expand Down Expand Up @@ -304,6 +304,52 @@ const { results, rowCount, executionTime } = await response.json();
</div>
</div>

<!-- PostgreSQL Server Package -->
<div class="package-section package-pg-server">
<div class="package-content">
<h3>4. PostgreSQL Wire Protocol Server</h3>
<ul class="package-features">
<li>Connect to MongoDB using any standard PostgreSQL client</li>
<li>Use tools like pgAdmin, DBeaver, or Beekeeper Studio</li>
<li>Native integration with any application supporting PostgreSQL</li>
<li>No specialized drivers or adapters needed</li>
<li>Transaction support (BEGIN, COMMIT, ROLLBACK)</li>
</ul>
<div class="package-buttons">
<a href="usage/postgres-server/" class="md-button">
PostgreSQL Server Documentation
</a>
</div>
</div>
<div class="package-code">
```bash
# Install globally
npm install -g @queryleaf/postgres-server

# Start the PostgreSQL-compatible server
queryleaf-pg-server --db mydb

# Connect with any PostgreSQL client:
psql -h localhost -p 5432 -d mydb -U any_username
```

```
# Or use in your application code:
import { MongoClient } from 'mongodb';
import { PostgresServer } from '@queryleaf/postgres-server';

// Create and start the server
const mongoClient = new MongoClient('mongodb://localhost:27017');
await mongoClient.connect();

const pgServer = new PostgresServer(mongoClient, 'mydb', {
port: 5432,
host: 'localhost'
});
```
</div>
</div>

<div class="package-buttons-container">
<a href="getting-started/installation/" class="md-button md-button--primary">
Get Started with QueryLeaf
Expand Down Expand Up @@ -338,6 +384,11 @@ const { results, rowCount, executionTime } = await response.json();
background: linear-gradient(to right, #f5f9f5, #ffffff);
}

.package-pg-server {
background: linear-gradient(to right, #ffffff, #f5f9f5);
flex-direction: row-reverse;
}

.package-content, .package-code {
flex: 1;
padding: 30px;
Expand Down Expand Up @@ -414,7 +465,7 @@ const { results, rowCount, executionTime } = await response.json();
<li>Full feature set</li>
<li>Commercial license</li>
<li>Email support</li>
<li>All packages included (Library, CLI, Server)</li>
<li>All packages included (Library, CLI, Web Server, PostgreSQL Server)</li>
<li>Use in proprietary applications</li>
<li>No AGPL requirements</li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions docs/overrides/partials/integrations/analytics/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- Fathom - beautiful, simple website analytics -->
<script src="https://cdn.usefathom.com/script.js" data-spa="auto" data-site="SGMKGHHQ" defer></script> <!-- / Fathom -->
77 changes: 77 additions & 0 deletions docs/support/license-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# License FAQ

## General Questions

### What license does QueryLeaf use?
QueryLeaf uses a dual licensing model:
- GNU Affero General Public License v3 (AGPL-3.0) for the Community Edition
- Commercial License for businesses using QueryLeaf in proprietary applications

### What is the difference between the AGPL and Commercial Licenses?
The AGPL is a strong copyleft license that requires any modifications to be shared under the same license and requires source code disclosure if you run a modified version as a service. The Commercial License removes these requirements, allowing you to use QueryLeaf in proprietary applications without disclosing your source code.

### Which license should I choose?
- Choose the **AGPL license** if you are working on open source projects, personal projects, or for evaluation.
- Choose the **Commercial License** if you are using QueryLeaf in a proprietary application, especially if you're offering it as a service or if you need commercial support.

## AGPL Questions

### Can I use the AGPL version in a commercial project?
Yes, but with important caveats. If your application is offered as a service (including web applications), the AGPL requires you to make the source code of your application available to users, including any modifications you've made to QueryLeaf.

### Does the AGPL affect my entire application?
Yes, the AGPL's copyleft provisions generally extend to the entire application that incorporates the AGPL-licensed code, not just the QueryLeaf parts.

### What if I'm only using QueryLeaf internally?
Even internal usage may trigger AGPL requirements if users (including employees) interact with the application over a network. For purely internal tools where source code is never shared outside your organization, AGPL may be suitable, but consult with your legal team.

## Commercial License Questions

### What does the Commercial License cover?
The Commercial License covers all QueryLeaf components:
- Core library
- Command-line interface (CLI)
- Web Server
- PostgreSQL Server

### Are there any usage limitations with the Commercial License?
The Commercial License prohibits:
- Using QueryLeaf to create a competing product
- Redistributing QueryLeaf as a standalone product
- Removing copyright notices

### Do I need a license for each developer or for each deployment?
Our pricing is structured per developer for the Developer License. The Business License covers unlimited developers. There are no additional per-deployment or per-server fees.

### Do I need to purchase a separate license for the PostgreSQL Server?
No, all server components (Web Server and PostgreSQL Server) are included in the same Commercial License. There's no need to purchase separate licenses for different components.

## Server-specific Questions

### Does the AGPL apply to the PostgreSQL Server and Web Server components?
Yes, if you're using the AGPL version, the license requirements apply to both server components. If you run either server as a service, you must make the source code (including modifications) available to users of that service.

### Are there any technical limitations in the Community Edition of the servers?
No, the Community Edition includes the full functionality of both server components. The difference is purely in the licensing terms, not in technical capabilities.

### Can I embed the PostgreSQL Server in my application?
- With the **AGPL license**: Yes, but you must make your application's source code available to users.
- With the **Commercial license**: Yes, with no requirement to disclose your source code.

## Support Questions

### Does the Commercial License include support?
Yes, all commercial licenses include email support. Higher-tier licenses include priority support, quarterly reviews, and dedicated account managers.

### Is there any support for the Community Edition?
Community support is available through GitHub issues. Commercial support is only available with a paid license.

### How do I upgrade my license?
To upgrade from Developer to Business or from Business to Enterprise, contact [[email protected]](mailto:[email protected]) with your current license information.

## Still Have Questions?

If you have additional questions about licensing or need help determining which license is right for you, please contact us:

- Email: [[email protected]](mailto:[email protected])
- Subject: "License Question"
91 changes: 91 additions & 0 deletions docs/support/pricing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Pricing & Licensing

QueryLeaf uses a dual-licensing model designed to balance open source availability with sustainable commercial development.

## Licensing Options

QueryLeaf is available under two licensing options:

1. **AGPL v3 License (Community Edition)** - Free for open source projects, personal use, and evaluation
2. **Commercial License** - For commercial use in proprietary applications

## Community Edition

The Community Edition of QueryLeaf is licensed under the [GNU Affero General Public License v3 (AGPL-3.0)](https://www.gnu.org/licenses/agpl-3.0.html). This license:

- Allows free use, modification, and distribution of the software
- Requires that any modifications to the software be shared under the same license
- Requires source code disclosure if you run a modified version of the software as a service over a network
- Has strong copyleft provisions that may affect proprietary applications

The AGPL license is perfect for:
- Open source projects
- Personal projects
- Educational purposes
- Evaluation before purchase

## Commercial License

Our Commercial License is designed for businesses and organizations that require more flexibility in how they use and distribute QueryLeaf. This license:

- Removes the AGPL requirements for source code disclosure
- Allows integration into proprietary software without license contamination
- Provides commercial support options
- Includes all components: Library, CLI, Web Server, and PostgreSQL Server

## Pricing Plans

### Developer License
- **$49** per developer per month
- Ideal for individual developers and small teams
- Includes:
- Full feature set
- Commercial license
- Email support
- All packages (Library, CLI, Web Server, PostgreSQL Server)
- Use in proprietary applications
- No AGPL requirements

### Business License
- Starting at **$99+** per month
- Perfect for teams and growing businesses
- Includes:
- Everything in Developer tier
- Unlimited developers
- Priority email support
- Quarterly reviews
- Performance optimization
- Extended security updates

### Enterprise License
- **Custom pricing** based on your needs
- For organizations requiring dedicated support and custom features
- Includes:
- Everything in Business tier
- Dedicated account manager
- Priority support with SLA
- Custom development available
- Deployment assistance
- Training and onboarding

## Server Components and Licensing

Both the Web Server and PostgreSQL Server components are covered under the same dual-licensing model. This means:

1. **Under AGPL**: If you run either server as a service, you must make the source code (including any modifications) available to users of that service.

2. **Under Commercial License**: You can run and distribute the server components as part of your proprietary applications without AGPL obligations.

The PostgreSQL Server component is particularly valuable for commercial users as it allows seamless integration with existing PostgreSQL clients and tools, making it ideal for enterprise deployments.

## How to Purchase

For more information or to purchase a commercial license:

- **Developer License**: [Email [email protected]](mailto:[email protected]?subject=QueryLeaf Developer License)
- **Business License**: [Email [email protected]](mailto:[email protected]?subject=QueryLeaf Business License)
- **Enterprise License**: [Email [email protected]](mailto:[email protected]?subject=QueryLeaf Enterprise License)

## Need Help?

For questions about licensing or to discuss your specific needs, please [contact our sales team](mailto:[email protected]).
Loading
Loading