Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Perl

This branch is even with tokuhirom:add_from

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/SQL
t
xt
.gitignore
.shipit
Changes
MANIFEST
MANIFEST.SKIP
Makefile.PL
README.mkdn

README.mkdn

NAME

SQL::Builder - SQL builder class

SYNOPSIS

use SQL::Builder;

my $builder = SQL::Builder->new();

# SELECT
my ($sql, @binds) = $builder->select($table, \@fields, \%where, \%opt);

# INSERT
my ($sql, @binds) = $builder->insert($table, \%values);

# DELETE
my ($sql, @binds) = $builder->delete($table, \%values);

# UPDATE
my ($sql, @binds) = $builder->update($table, \%set, \%where);

DESCRIPTION

SQL::Builder is SQL builder class. It is based on DBIx::Skinny's SQL generator.

METHODS

  • my $builder = SQL::Builder->new(%args);

Create new instance of SQL::Builder.

Attribuetes are following:

- driver: Str

- dbh: Object

Driver or dbh is required. The driver type is needed to create SQL string.

- quote_char: Str

This is the character that a table or column name will be quoted with. 

Default: auto detect from $driver.

- name_sep: Str

This is the character that separates a table and column name.

Default: '.'
  • my ($sql, @binds) = $builder->select($table, \@fields, \%where, \%opt);

Generates SELECT query.

  • my ($sql, @binds) = $builder->insert($table, \%values);

Generate INSERT query.

  • my ($sql, @binds) = $builder->delete($table, \%values);

Generate DELETE query.

  • my ($sql, @binds) = $builder->update($table, \%set, \%where);

Generate UPDATE query.

AUTHOR

Tokuhiro Matsuno

SEE ALSO

SQL::Abstract

Whole code was taken from DBIx::Skinny by nekokak++.

LICENSE

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Something went wrong with that request. Please try again.