Skip to content
Alex edited this page Jul 29, 2018 · 9 revisions

Description

Terrazine is not just parser of data structures in to SQL. It provides tools for sending query to db, parsing result and presenting it.

Building SQL

SQL described by data structures. You can build data structures with the help of Constructor, that provides methods like select, join, with and so on. In future I would add helper methods for structures building.

You can initialize constructor by Terrazine.new_constructor(structure = {}) Now it under development and have only several methods, some of them just rewrite structure without merging it.

Helper methods

Just helpers for describing data structure... they are still at the stage of deliberation-_- Someone advise me to add more functions - they are easier than data structures?

Sending query

You can send request by Terrazine.send_request(structure, params = {}). For now params used for parsing/representing result options and for specifying db connection.

  • :connection - db connection instance
  • :types - describing db result parsing structure. For example if you from db got result.field => '{val_1, val_2}' you should add types: {field: :array} to params
  • :presenter_options
Clone this wiki locally