https://github.com/standard-query-language/csqly
CSQLY is a simplified query language for multiple databases that allows you to write database queries in YAML format and execute them against different database engines.
https://github.com/standard-query-language/csqly
dotnet nuget yaml
Last synced: 2 months ago
JSON representation
CSQLY is a simplified query language for multiple databases that allows you to write database queries in YAML format and execute them against different database engines.
- Host: GitHub
- URL: https://github.com/standard-query-language/csqly
- Owner: Standard-Query-Language
- License: mit
- Created: 2025-03-13T15:12:36.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-03-13T16:34:02.000Z (2 months ago)
- Last Synced: 2025-03-13T16:34:24.334Z (2 months ago)
- Topics: dotnet, nuget, yaml
- Language: C#
- Homepage: https://standard-query-language.github.io/CSQLY/
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# CSQLY - SQL with YAML
[](https://github.com/Standard-Query-Language/CSQLY/actions/workflows/build.yml)
[](https://www.nuget.org/packages/CSQLY/)
[](https://opensource.org/licenses/MIT)CSQLY is a simplified query language for multiple databases that allows you to write database queries in YAML format and execute them against different database engines.
## Features
- Write database queries in easy-to-read YAML format
- Support for multiple database types:
- SQLite
- MySQL/MariaDB
- PostgreSQL
- Oracle
- Microsoft SQL Server
- Simplified query syntax with type safety
- Connection pooling and management
- Easily extensible architecture
- Command-line interface for quick queries## Installation
### Package Manager Console
```
Install-Package CSQLY
```### .NET CLI
```bash
dotnet add package CSQLY
```## Basic Usage
```csharp
using CSQLY.Core;
using CSQLY.Connectors;// Create a database connection
var connector = DatabaseConnector.Create(DatabaseType.SQLite, "Data Source=mydb.sqlite");// Execute a CSQLY query
var result = await connector.ExecuteQueryAsync(@"
select:
columns:
- name
from: users
where:
active: true
");// Process results
foreach (var row in result)
{
Console.WriteLine($"Name: {row["name"]}, Email: {row["email"]}");
}
```## Command-Line Interface
CSQLY also provides a command-line interface for quick queries:
```bash
# Install the CLI tool
dotnet tool install --global CSQLY.CLI# Execute a query from a file
csqly -f query.yaml -c "Data Source=mydb.sqlite" -t sqlite
```## Documentation
For detailed documentation, see:
- [Getting Started](docs/getting-started.md)
- [Query Syntax](docs/query-syntax.md)
- [Database Connectors](docs/database-connectors.md)
- [CLI Usage](docs/cli-usage.md)
- [API Reference](docs/api-reference.md)## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull RequestSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.