Giter Site home page Giter Site logo

filipeesch / dynamic-sql Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 2.0 75 KB

A .NET library designed to create complex, parameterized SQL queries dynamically using a versatile template syntax. Effortlessly handle conditional logic, integrate variable lists, and generate optimized SQL statements with ease. Ideal for applications requiring flexible SQL construction with maximum code safety and readability.

License: MIT License

C# 100.00%
dotnet query query-builder sql

dynamic-sql's People

Contributors

filipeesch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dynamic-sql's Issues

Implement Reader Pipeline for Streamlined Data Processing in Query Execution

Objective: Develop a reader pipeline method within the library to enable streamlined and efficient data processing during SQL query execution. This method should allow the chaining of handlers that utilize ChannelReader and ChannelWriter, facilitating a smooth flow of data through various processing stages.

Key Requirements:

  1. Pipeline Structure: The method should allow the client application to execute a query and create a sequence (or chain) of handlers. Each handler in this pipeline should accept a ChannelReader (for input) and a ChannelWriter (for output).

  2. Configurable Channel Size: The buffer size of each channel (both ChannelReader and ChannelWriter) should be configurable, allowing for flexibility based on different data processing needs and scenarios.

  3. Concurrent Execution: Each step in the pipeline should be executed in a separate thread. This approach aims to facilitate stream processing of the query results, leveraging the benefits of multi-threading for enhanced performance and efficiency.

  4. Use Case - Data Transformation: This feature is particularly useful for scenarios requiring data transformation on the query results, such as deserialization or other forms of data processing.

  5. IAsyncEnumerable Output: The reader pipeline method should return an IAsyncEnumerable, enabling the asynchronous streaming of the pipeline results to the client application.

  6. Documentation and Examples: Comprehensive documentation should be provided, detailing how to set up and use the reader pipeline method. This should include example use cases and guidance on configuring the pipeline for different scenarios.

Acceptance Criteria:

  • Successful implementation of a reader pipeline method with ChannelReader and ChannelWriter.
  • Ability to configure the channel size for each step in the pipeline.
  • Each pipeline step runs concurrently in a separate thread, ensuring efficient stream processing.
  • The method returns an IAsyncEnumerable for the final output, adhering to asynchronous programming patterns.
  • The feature is well-documented with clear examples and use case scenarios.
  • Adequate unit tests to ensure the functionality works as expected under various conditions.

Create unit tests

Create unit test to guarantee the property sql rendering and parametrizarion

Implement Compiled Statement Output for Enhanced Readability and Performance

Objective: Enhance the library to facilitate easier and more efficient data retrieval from SQL query results. The focus is on creating a mechanism that maps query result columns directly to the properties of an output class, thereby improving the readability and usability of the data retrieval process.

Key Requirements:

  1. Property-Column Mapping: The mechanism should automatically assume that the property names of the output class correspond to the column names in the SQL query result. This mapping should be intuitive and require minimal configuration from the user's end.

  2. Compiled Read Statement: To ensure high performance, the read statement mechanism should be compiled, rather than interpreted at runtime. This compilation approach should ideally eliminate the need for reflection during the query execution flow, thereby enhancing execution speed and reducing overhead.

  3. Non-Reflective Approach: The solution should avoid using reflection for mapping data from the SQL result set to the properties of the output class. This is to ensure that the performance remains optimal, particularly in scenarios where the query is executed frequently or deals with large datasets.

  4. Integration with Existing Library Structure: The new feature should seamlessly integrate with the library's existing functionality. It should complement the dynamic SQL generation features, providing an end-to-end solution for both creating and consuming SQL queries.

  5. Documentation and Examples: Update the library documentation to include clear instructions and examples on how to use this new feature. This should cover typical use cases and demonstrate how the feature improves data retrieval processes.

  6. Unit Tests: Ensure thorough unit testing of the new feature to verify its correctness, efficiency, and robustness.

Acceptance Criteria:

  • Successful implementation of a compiled read statement mechanism.
  • Automatic and accurate mapping of SQL result set columns to the corresponding properties of the output class.
  • Demonstrable improvement in performance, especially in comparison to a reflective approach.
  • Comprehensive documentation and example use cases provided.
  • All new code is well-tested with unit tests covering various scenarios.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.