Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql_tree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql_tree

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= SQLTree

SQLTree is a pure Ruby library to represent SQL queries with a syntax tree for inspection and modification.

The library can parse an SQL query (a string) to represent the query using a syntax tree, and it can generate an SQL query from a syntax tree. The syntax tree ca be used to inspect to query, or to modify it.

This library is currently in the early stages. This means that the API is not yet stable and not all SQL constructs are implemented yet.

== Installation

The SQLTree library is distributed as a gem. To install:

gem install sql_tree

Or, add gem 'sql_tree' to your project's Gemfile and run bundle install.

== Usage

Consider the following example:

require 'sql_tree' tree = SQLTree["SELECT * FROM table WHERE field = 'value'"] where = SQLTree::Node::Expression["username = 'user' AND password = MD5('$secret')"] tree.where = where # replace WHERE expression puts tree.to_sql

"SELECT * FROM "table" WHERE (("username" = 'user') AND ("password" = MD5('$secret')))"

== Additional information

This library is written by Willem van Bergen and is MIT licensed (see the LICENSE file).

  • Full RDoc API documentation can be found at http://rdoc.info/projects/wvanbergen/sql_tree
  • See the project wiki at http://github.com/wvanbergen/sql_tree/wiki for more information about using this library.

FAQs

Package last updated on 30 Jan 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc