source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/oracle.rb
Ruby
mit
5,086
master
13,172
# frozen-string-literal: true require 'oci8' require_relative 'shared/oracle' module Sequel module Oracle class Database < Sequel::Database include DatabaseMethods set_adapter_scheme :oracle # ORA-00028: your session has been killed # ORA-01012: not logged on # ORA-02396: exceeded...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/odbc.rb
Ruby
mit
5,086
master
4,011
# frozen-string-literal: true require 'odbc' module Sequel module ODBC # Contains procs keyed on subadapter type that extend the # given database object so it supports the correct database type. DATABASE_SETUP = {} class Database < Sequel::Database set_adapter_scheme :odbc def co...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/sqlanywhere.rb
Ruby
mit
5,086
master
5,397
# frozen-string-literal: true require 'sqlanywhere' require_relative 'shared/sqlanywhere' module Sequel module SqlAnywhere class SQLAnywhereException < StandardError attr_reader :errno attr_reader :sql def initialize(message, errno, sql) super(message) @errno = errno ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/trilogy.rb
Ruby
mit
5,086
master
2,979
# frozen-string-literal: true require 'trilogy' require_relative 'shared/mysql' module Sequel module Trilogy class Database < Sequel::Database include Sequel::MySQL::DatabaseMethods QUERY_FLAGS = ::Trilogy::QUERY_FLAGS_CAST | ::Trilogy::QUERY_FLAGS_CAST_BOOLEANS LOCAL_TIME_QUERY_FLAGS = QUERY...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/sqlite.rb
Ruby
mit
5,086
master
15,492
# frozen-string-literal: true require 'sqlite3' require_relative 'shared/sqlite' module Sequel module SQLite FALSE_VALUES = (%w'0 false f no n'.each(&:freeze) + [0]).freeze blob = Object.new def blob.call(s) Sequel::SQL::Blob.new(s.to_s) end boolean = Object.new def boolean.call(s) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/tinytds.rb
Ruby
mit
5,086
master
8,211
# frozen-string-literal: true require 'tiny_tds' require_relative 'shared/mssql' module Sequel module TinyTDS class Database < Sequel::Database include Sequel::MSSQL::DatabaseMethods set_adapter_scheme :tinytds # Transfer the :user option to the :username option. def connect(server) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/postgres.rb
Ruby
mit
5,086
master
33,672
# frozen-string-literal: true require_relative 'shared/postgres' begin require 'pg' # :nocov: Sequel::Postgres::PGError = PG::Error if defined?(PG::Error) Sequel::Postgres::PGconn = PG::Connection if defined?(PG::Connection) Sequel::Postgres::PGresult = PG::Result if defined?(PG::Result) # Work around...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc.rb
Ruby
mit
5,086
master
29,549
# frozen-string-literal: true require 'java' require_relative 'utils/stored_procedures' module Sequel module JDBC # Make it accesing the java.sql hierarchy more ruby friendly. module JavaSQL include_package 'java.sql' end # Used to identify a jndi connection and to extract the jndi # reso...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/ado/access.rb
Ruby
mit
5,086
master
10,838
# frozen-string-literal: true require_relative '../shared/access' require_relative '../utils/split_alter_table' module Sequel module ADO # Database and Dataset instance methods for Access specific # support via ADO. module Access class AdoSchema QUERY_TYPE = { :columns => 4, ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/ado/mssql.rb
Ruby
mit
5,086
master
2,014
# frozen-string-literal: true require_relative '../shared/mssql' module Sequel module ADO module MSSQL module DatabaseMethods include Sequel::MSSQL::DatabaseMethods def execute_dui(sql, opts=OPTS) return super unless @opts[:provider] synchronize(opts[:server]) do |conn...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/access.rb
Ruby
mit
5,086
master
9,387
# frozen-string-literal: true require_relative '../utils/emulate_offset_with_reverse_and_count' require_relative '../utils/unmodified_identifiers' require_relative '../utils/columns_limit_1' module Sequel module Access Sequel::Database.set_shared_adapter_scheme(:access, self) module DatabaseMethods i...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/sqlanywhere.rb
Ruby
mit
5,086
master
14,749
# frozen-string-literal: true require_relative '../utils/columns_limit_1' module Sequel module SqlAnywhere Sequel::Database.set_shared_adapter_scheme(:sqlanywhere, self) module DatabaseMethods attr_reader :conversion_procs # Set whether to convert smallint type to boolean for this Database ins...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/sqlite.rb
Ruby
mit
5,086
master
41,420
# frozen-string-literal: true require_relative '../utils/replace' require_relative '../utils/unmodified_identifiers' module Sequel module SQLite Sequel::Database.set_shared_adapter_scheme(:sqlite, self) def self.mock_adapter_setup(db) db.instance_exec do @sqlite_version = 30903 def s...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/mysql.rb
Ruby
mit
5,086
master
41,475
# frozen-string-literal: true require_relative '../utils/replace' require_relative '../utils/split_alter_table' require_relative '../utils/unmodified_identifiers' module Sequel module MySQL Sequel::Database.set_shared_adapter_scheme(:mysql, self) def self.mock_adapter_setup(db) db.instance_exec do ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/postgres.rb
Ruby
mit
5,086
master
115,920
# frozen-string-literal: true require_relative '../utils/unmodified_identifiers' module Sequel # Top level module for holding all PostgreSQL-related modules and classes # for Sequel. All adapters that connect to PostgreSQL support the following options: # # :client_min_messages :: Change the minimum level of...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/db2.rb
Ruby
mit
5,086
master
17,083
# frozen-string-literal: true require_relative '../utils/emulate_offset_with_row_number' require_relative '../utils/columns_limit_1' module Sequel module DB2 Sequel::Database.set_shared_adapter_scheme(:db2, self) module DatabaseMethods # Whether to use clob as the generic File type, false by default....
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/mssql.rb
Ruby
mit
5,086
master
45,368
# frozen-string-literal: true require_relative '../utils/emulate_offset_with_row_number' require_relative '../utils/split_alter_table' module Sequel module MSSQL Sequel::Database.set_shared_adapter_scheme(:mssql, self) def self.mock_adapter_setup(db) db.instance_exec do @server_version = 1100...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/shared/oracle.rb
Ruby
mit
5,086
master
24,229
# frozen-string-literal: true require_relative '../utils/emulate_offset_with_row_number' require_relative '../../extensions/auto_cast_date_and_time' module Sequel module Oracle Sequel::Database.set_shared_adapter_scheme(:oracle, self) def self.mock_adapter_setup(db) db.instance_exec do @s...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/odbc/mssql.rb
Ruby
mit
5,086
master
1,634
# frozen-string-literal: true require_relative '../shared/mssql' module Sequel module ODBC Sequel.synchronize do DATABASE_SETUP[:mssql] = proc do |db| db.extend Sequel::ODBC::MSSQL::DatabaseMethods db.dataset_class = Sequel::ODBC::MSSQL::Dataset db.send(:set_mssql_unicode_strings) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/odbc/db2.rb
Ruby
mit
5,086
master
248
# frozen-string-literal: true require_relative '../shared/db2' Sequel.synchronize do Sequel::ODBC::DATABASE_SETUP[:db2] = proc do |db| db.extend ::Sequel::DB2::DatabaseMethods db.extend_datasets ::Sequel::DB2::DatasetMethods end end
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/odbc/oracle.rb
Ruby
mit
5,086
master
260
# frozen-string-literal: true require_relative '../shared/oracle' Sequel.synchronize do Sequel::ODBC::DATABASE_SETUP[:oracle] = proc do |db| db.extend ::Sequel::Oracle::DatabaseMethods db.extend_datasets ::Sequel::Oracle::DatasetMethods end end
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/db2.rb
Ruby
mit
5,086
master
2,230
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::ComIbmDb2Jcc::DB2Driver') require_relative '../shared/db2' require_relative 'transactions' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:db2] = proc do |db| db.singleton_class.class_eval do alias jdbc_schema_...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/sqlanywhere.rb
Ruby
mit
5,086
master
2,325
# frozen-string-literal: true require_relative '../shared/sqlanywhere' require_relative 'transactions' module Sequel module JDBC drv = [ lambda{Java::SybaseJdbc4Sqlanywhere::IDriver}, lambda{Java::IanywhereMlJdbcodbcJdbc4::IDriver}, lambda{Java::SybaseJdbcSqlanywhere::IDriver}, lambda{Ja...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/postgresql.rb
Ruby
mit
5,086
master
8,409
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::OrgPostgresql::Driver', :Postgres) require_relative '../shared/postgres' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:postgresql] = proc do |db| db.dataset_class = Sequel::JDBC::Postgres::Dataset db.extend(Seq...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/derby.rb
Ruby
mit
5,086
master
10,479
# frozen-string-literal: true # SEQUEL6: Remove Sequel::JDBC.load_driver('Java::OrgApacheDerbyJdbc::EmbeddedDriver', :Derby) require_relative 'transactions' require_relative '../utils/columns_limit_1' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:derby] = proc do |db| db.extend(...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/mssql.rb
Ruby
mit
5,086
master
757
# frozen-string-literal: true require_relative '../shared/mssql' module Sequel module JDBC module MSSQL module DatabaseMethods include Sequel::MSSQL::DatabaseMethods private # Get the last inserted id using SCOPE_IDENTITY(). def last_insert_id(conn, opts=O...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/sqlite.rb
Ruby
mit
5,086
master
4,712
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::OrgSqlite::JDBC', :SQLite3) require_relative '../shared/sqlite' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:sqlite] = proc do |db| db.extend(Sequel::JDBC::SQLite::DatabaseMethods) db.extend_datasets Sequel::S...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/jtds.rb
Ruby
mit
5,086
master
1,100
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::NetSourceforgeJtdsJdbc::Driver', :JTDS) require_relative 'mssql' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:jtds] = proc do |db| db.extend(Sequel::JDBC::JTDS::DatabaseMethods) db.extend_datasets Sequel::MSSQ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/oracle.rb
Ruby
mit
5,086
master
4,188
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::OracleJdbcDriver::OracleDriver') require_relative '../shared/oracle' require_relative 'transactions' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:oracle] = proc do |db| db.extend(Sequel::JDBC::Oracle::DatabaseMethods)...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/transactions.rb
Ruby
mit
5,086
master
3,683
# frozen-string-literal: true module Sequel module JDBC module Transactions def freeze supports_savepoints? super end # Check the JDBC DatabaseMetaData for savepoint support def supports_savepoints? return @supports_savepoints if defined?(@supports_savepoints) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/h2.rb
Ruby
mit
5,086
master
8,939
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::OrgH2::Driver', :H2) require_relative '../../extensions/auto_cast_date_and_time' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:h2] = proc do |db| db.extend(Sequel::JDBC::H2::DatabaseMethods) db.dataset_class = ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/hsqldb.rb
Ruby
mit
5,086
master
7,756
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::OrgHsqldb::jdbcDriver', :HSQLDB) require_relative 'transactions' require_relative '../../extensions/auto_cast_date_and_time' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:hsqldb] = proc do |db| db.extend(Sequel::JDBC::...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/sqlserver.rb
Ruby
mit
5,086
master
3,078
# frozen-string-literal: true Sequel::JDBC.load_driver('Java::ComMicrosoftSqlserverJdbc::SQLServerDriver') require_relative 'mssql' module Sequel module JDBC Sequel.synchronize do DATABASE_SETUP[:sqlserver] = proc do |db| db.extend(Sequel::JDBC::SQLServer::DatabaseMethods) db.extend_datase...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/jdbc/mysql.rb
Ruby
mit
5,086
master
3,124
# frozen-string-literal: true module Sequel module JDBC driver = Sequel::JDBC.load_driver(%w'Java::ComMysqlCjJdbc::Driver Java::ComMysqlJdbc::Driver', :MySQL) require_relative '../shared/mysql' Sequel.synchronize do DATABASE_SETUP[:mysql] = proc do |db| db.extend(Sequel::JDBC::MySQL::Datab...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/split_alter_table.rb
Ruby
mit
5,086
master
1,501
# frozen-string-literal: true module Sequel::Database::SplitAlterTable private # Preprocess the array of operations. If it looks like some operations depend # on results of earlier operations and may require reloading the schema to # work correctly, split those operations into separate lists, and between eac...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/replace.rb
Ruby
mit
5,086
master
850
# frozen-string-literal: true module Sequel class Dataset module Replace # Execute a REPLACE statement on the database (deletes any duplicate # rows before inserting). def replace(*values) execute_insert(replace_sql(*values)) end # SQL statement for REPLACE def replac...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/stored_procedures.rb
Ruby
mit
5,086
master
1,677
# frozen-string-literal: true module Sequel class Dataset module StoredProcedureMethods # The name of the stored procedure to call def sproc_name @opts[:sproc_name] end # Call the stored procedure with the given args def call(*args, &block) clone(:sproc_args=...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/emulate_offset_with_row_number.rb
Ruby
mit
5,086
master
3,131
# frozen-string-literal: true module Sequel module EmulateOffsetWithRowNumber # If the offset must be emulated with ROW_NUMBER, don't remove any ordering, # because it can cause invalid queries to be issued if an offset is required # when ordering. def empty? return super unless emulate_offset_...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/mysql_mysql2.rb
Ruby
mit
5,086
master
3,076
# frozen-string-literal: true require_relative '../shared/mysql' require_relative 'stored_procedures' module Sequel module MySQL # This module is used by the mysql and mysql2 adapters to support # prepared statements and stored procedures. module MysqlMysql2 module DatabaseMethods disconne...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/mysql_prepared_statements.rb
Ruby
mit
5,086
master
2,169
# frozen-string-literal: true module Sequel module MySQL module PreparedStatements module DatabaseMethods private # Executes a prepared statement on an available connection. If the # prepared statement already exists for the connection and has the same # SQL, reuse it, oth...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/emulate_offset_with_reverse_and_count.rb
Ruby
mit
5,086
master
2,568
# frozen-string-literal: true module Sequel module EmulateOffsetWithReverseAndCount # Make empty? work with an offset with an order. # By default it would break since the order would be based on # a column that empty does not select. def empty? if o = @opts[:offset] unlimited.count <= o...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/unmodified_identifiers.rb
Ruby
mit
5,086
master
631
# frozen-string-literal: true module Sequel module UnmodifiedIdentifiers module DatabaseMethods private # Databases that use this module for unquoted identifiers to lowercase. def folds_unquoted_identifiers_to_uppercase? false end end module DatasetMethods private ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/adapters/utils/columns_limit_1.rb
Ruby
mit
5,086
master
560
# frozen-string-literal: true module Sequel class Dataset module ColumnsLimit1 COLUMNS_CLONE_OPTIONS = {:distinct => nil, :limit => 1, :offset=>nil, :where=>nil, :having=>nil, :order=>nil, :row_proc=>nil, :graph=>nil, :eager_graph=>nil}.freeze # Use a limit of 1 instead of a limit of 0 when # ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/unlimited_update.rb
Ruby
mit
5,086
master
687
# frozen-string-literal: true module Sequel module Plugins # The unlimited_update plugin is designed to work around a # MySQL warning in replicated environments, which occurs if # you issue an UPDATE with a LIMIT clause. # # Usage: # # # Make all model subclass not use a limit for updat...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/xml_serializer.rb
Ruby
mit
5,086
master
15,530
# frozen-string-literal: true require 'nokogiri' module Sequel module Plugins # The xml_serializer plugin handles serializing entire Sequel::Model # objects to XML, and deserializing XML into a single Sequel::Model # object or an array of Sequel::Model objects. It requires the # nokogiri library. ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/column_select.rb
Ruby
mit
5,086
master
2,183
# frozen-string-literal: true module Sequel module Plugins # The column_select plugin changes the default selection for a # model dataset to explicit select all columns from the table: # <tt>table.column1, table.column2, table.column3, ...</tt>. # This makes it simpler to add columns to the model's t...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/list.rb
Ruby
mit
5,086
master
7,911
# frozen-string-literal: true module Sequel module Plugins # The list plugin allows for model instances to be part of an ordered list, # based on a position field in the database. It can either consider all # rows in the table as being from the same list, or you can specify scopes # so that multiple...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/accessed_columns.rb
Ruby
mit
5,086
master
1,852
# frozen-string-literal: true module Sequel module Plugins # The accessed_columns plugin records which columns have been # accessed for a model instance. This is useful if you are # looking to remove other columns from being SELECTed by the # dataset that retrieved the instance, which can significan...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/composition.rb
Ruby
mit
5,086
master
8,431
# frozen-string-literal: true module Sequel module Plugins # The composition plugin allows you to easily define a virtual # attribute where the backing data is composed of other columns. # # There are two ways to use the plugin. One way is with the # :mapping option. A simple example of this is...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/typecast_on_load.rb
Ruby
mit
5,086
master
3,023
# frozen-string-literal: true module Sequel module Plugins # The typecast_on_load plugin exists because most of Sequel's database adapters don't # have complete control over typecasting, and may return columns that aren't # typecast correctly (with correct being defined as how the model object # woul...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/pg_row.rb
Ruby
mit
5,086
master
2,721
# frozen-string-literal: true module Sequel module Plugins # The pg_row plugin allows you to use Sequel::Model classes as composite type # classes, via the pg_row extension. So if you have an address table: # # DB.create_table(:address) do # String :street # String :city # ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/table_select.rb
Ruby
mit
5,086
master
1,620
# frozen-string-literal: true module Sequel module Plugins # The table_select plugin changes the default selection for a # model dataset from <tt>*</tt> to <tt>table.*</tt>. # This makes it so that if you join the model's dataset to # other tables, columns in the other tables do not appear # in t...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/prepared_statements_safe.rb
Ruby
mit
5,086
master
3,156
# frozen-string-literal: true module Sequel module Plugins # The prepared_statements_safe plugin modifies the model to reduce the number of # prepared statements that can be created, by setting as many columns as possible # before creating, and by changing +save_changes+ to save all columns instead of ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/association_proxies.rb
Ruby
mit
5,086
master
5,446
# frozen-string-literal: true module Sequel module Plugins # Sequel by default does not use proxies for associations. The association # method for *_to_many associations returns an array, and the association_dataset # method returns a dataset. This plugin makes the association method return a proxy ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/instance_filters.rb
Ruby
mit
5,086
master
4,633
# frozen-string-literal: true module Sequel module Plugins # This plugin allows you to add filters on a per object basis that # restrict updating or deleting the object. It's designed for cases # where you would normally have to drop down to the dataset level # to get the necessary control, because ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/whitelist_security.rb
Ruby
mit
5,086
master
4,440
# frozen-string-literal: true module Sequel module Plugins # The whitelist_security plugin contains whitelist-based support for # mass assignment, explicitly specifying which columns to allow mass assignment for, # disallowing mass assignment for columns not listed. This exists mostly for backwards ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/column_conflicts.rb
Ruby
mit
5,086
master
4,175
# frozen-string-literal: true module Sequel module Plugins # The column_conflicts plugin overrides Model#get_column_value and #set_column_value # to automatically handle column names that conflict with Ruby/Sequel method names. # # By default, Model#get_column_value and #set_column_value just call se...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/auto_validations_constraint_validations_presence_message.rb
Ruby
mit
5,086
master
2,800
# frozen-string-literal: true module Sequel module Plugins # The auto_validations_constraint_validations_presence_message plugin provides # integration for the auto_validations and constraint_validations plugins in # the following situation: # # * A column has a NOT NULL constraint in the databas...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/subset_static_cache.rb
Ruby
mit
5,086
master
10,108
# frozen-string-literal: true module Sequel module Plugins # The subset_static_cache plugin is designed for model subsets that are not modified at all # in production use cases, or at least where modifications to them would usually # coincide with an application restart. When caching a model subset, it ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/serialization.rb
Ruby
mit
5,086
master
10,774
# frozen-string-literal: true module Sequel module Plugins # The serialization plugin allows you to keep serialized # ruby objects in the database, while giving you deserialized objects # when you call an accessor. # # This plugin works by keeping the serialized value in the values, and # add...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/sql_comments.rb
Ruby
mit
5,086
master
7,183
# frozen-string-literal: true module Sequel module Plugins # The sql_comments plugin will automatically use SQL comments on # queries for the model it is loaded into. These comments will # show the related model, what type of method was called, and # the method name (or association name for queries ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/association_multi_add_remove.rb
Ruby
mit
5,086
master
3,710
# frozen-string-literal: true module Sequel module Plugins # The association_multi_add_remove plugin allows adding, removing and setting # multiple associated objects in a single method call. # By default Sequel::Model defines singular <tt>add_*</tt> and <tt>remove_*</tt> # methods that operate on a ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/class_table_inheritance.rb
Ruby
mit
5,086
master
18,550
# frozen-string-literal: true module Sequel module Plugins # = Overview # # The class_table_inheritance plugin uses the single_table_inheritance # plugin, so it supports all of the single_table_inheritance features, but it # additionally supports subclasses that have additional columns, # whi...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/insert_returning_select.rb
Ruby
mit
5,086
master
2,712
# frozen-string-literal: true module Sequel module Plugins # If the model's dataset selects explicit columns (or table.*) and the # database supports it, the insert_returning_select plugin will # automatically set the RETURNING clause on the dataset used to # insert rows to the columns selected, whic...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/static_cache.rb
Ruby
mit
5,086
master
11,485
# frozen-string-literal: true module Sequel module Plugins # The static_cache plugin is designed for models that are not modified at all # in production use cases, or at least where modifications to them would usually # coincide with an application restart. When loaded into a model class, it # retr...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/timestamps.rb
Ruby
mit
5,086
master
4,755
# frozen-string-literal: true module Sequel module Plugins # The timestamps plugin creates hooks that automatically set create and # update timestamp fields. Both field names used are configurable, and you # can also set whether to overwrite existing create timestamps (false # by default), or wheth...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/finder.rb
Ruby
mit
5,086
master
9,831
# frozen-string-literal: true module Sequel module Plugins # The finder plugin adds Model.finder for defining optimized finder methods. # There are two ways to use this. The recommended way is to pass a symbol # that represents a model class method that returns a dataset: # # def Artist.by_nam...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/input_transformer.rb
Ruby
mit
5,086
master
3,263
# frozen-string-literal: true module Sequel module Plugins # InputTransformer is a plugin that allows generic transformations # of input values in model column setters. Example: # # Album.plugin :input_transformer # Album.add_input_transformer(:reverser){|v| v.is_a?(String) ? v.reverse : v} ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/async_thread_pool.rb
Ruby
mit
5,086
master
1,320
# frozen-string-literal: true module Sequel extension 'async_thread_pool' module Plugins # The async_thread_pool plugin makes it slightly easier to use the async_thread_pool # Database extension with models. It makes Model.async return an async dataset for the # model, and support async behavior for ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/single_table_inheritance.rb
Ruby
mit
5,086
master
10,465
# frozen-string-literal: true module Sequel module Plugins # The single_table_inheritance plugin allows storing all objects # in the same class hierarchy in the same table. It makes it so # subclasses of this model only load rows related to the subclass, # and when you retrieve rows from the main cl...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/dirty.rb
Ruby
mit
5,086
master
10,023
# frozen-string-literal: true module Sequel module Plugins # The dirty plugin makes Sequel save the initial value of # a column when setting a new value for the column. This # makes it easier to see what changes were made to the object: # # artist.name # => 'Foo' # arti...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/validation_contexts.rb
Ruby
mit
5,086
master
1,963
# frozen-string-literal: true module Sequel module Plugins # The validation_contexts plugin adds support for a validation_context method inside a validate # method. You pass in the validation context to use via the :validation_context option to # Sequel::Model#save && Sequel::Model#valid?: # # ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/delay_add_association.rb
Ruby
mit
5,086
master
1,846
# frozen-string-literal: true module Sequel module Plugins # The delay_add_association plugin delays the adding of # associated objects to a new (unsaved) object until after the new # object is saved. By default, if you attempt to add # associated objects to a new object, Sequel will raise # an ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/serialization_modification_detection.rb
Ruby
mit
5,086
master
3,046
# frozen-string-literal: true module Sequel module Plugins # This plugin extends the serialization plugin and enables it to detect # changes in serialized values by checking whether the current # deserialized value is the same as the original deserialized value. # The serialization plugin does not do...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/uuid.rb
Ruby
mit
5,086
master
2,188
# frozen-string-literal: true require 'securerandom' module Sequel module Plugins # The uuid plugin creates hooks that automatically create a uuid for every # instance. # # Usage: # # # Uuid all model instances using +uuid+ # # (called before loading subclasses) # Sequel::Mode...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/skip_create_refresh.rb
Ruby
mit
5,086
master
1,242
# frozen-string-literal: true module Sequel module Plugins # The skip_create_refresh plugin skips the # refresh after saving a new model object. Sequel does the # refresh by default to make sure all columns are populated, which is # necessary so that database defaults work correctly. # # Thi...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/singular_table_names.rb
Ruby
mit
5,086
master
1,107
# frozen-string-literal: true module Sequel module Plugins # The singular_table_names plugin changes the default # table names for subclasses to not assume a plural version. # By default, Sequel assumes table names for models use # the plural versions. # # Note that this plugin only affects s...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/deprecated_associations.rb
Ruby
mit
5,086
master
5,690
# frozen-string-literal: true module Sequel module Plugins # The deprecated_associations plugin adds support for # deprecating associations. Attempts to use association # methods and access association metadata for deprecated # associations results in a warning. # # Album.plugin :deprecated...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/paged_operations.rb
Ruby
mit
5,086
master
8,426
# frozen-string-literal: true module Sequel module Plugins # The paged_operations plugin adds +paged_update+ and # +paged_delete+ dataset methods. These behave similarly to # the default +update+ and +delete+ dataset methods, except # that the update or deletion is done in potentially multiple #...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/touch.rb
Ruby
mit
5,086
master
6,250
# frozen-string-literal: true module Sequel module Plugins # The touch plugin adds a touch method to model instances, which saves # the object with a modified timestamp. By default, it uses the # :updated_at column, but you can set which column to use. # It also supports touching of associations, so...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/rcte_tree.rb
Ruby
mit
5,086
master
15,720
# frozen-string-literal: true module Sequel module Plugins # = Overview # # The rcte_tree plugin deals with tree structured data stored # in the database using the adjacency list model (where child rows # have a foreign key pointing to the parent rows), using recursive # common table expressi...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/def_dataset_method.rb
Ruby
mit
5,086
master
3,683
# frozen-string-literal: true module Sequel module Plugins # The def_dataset_method plugin adds Model.def_dataset_method # for defining dataset methods: # # Album.def_dataset_method(:by_name) do |name| # where(name: name) # end # # Additionally, this adds support for Model.sub...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/columns_updated.rb
Ruby
mit
5,086
master
1,263
# frozen-string-literal: true module Sequel module Plugins # The columns_updated plugin stores the columns hash used in the # UPDATE query when saving the instance, and makes it available # in the after_update and after_save hooks via the +columns_updated+ # accessor. The data is cleared before retu...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/nested_attributes.rb
Ruby
mit
5,086
master
17,183
# frozen-string-literal: true module Sequel module Plugins # The nested_attributes plugin allows you to create, update, and delete # associated objects directly by calling a method on the current object. # Nested attributes are defined using the nested_attributes class method: # # Artist.one_to...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/column_encryption.rb
Ruby
mit
5,086
master
32,498
# frozen-string-literal: true # :nocov: raise(Sequel::Error, "Sequel column_encryption plugin requires ruby 2.3 or greater") unless RUBY_VERSION >= '2.3' # :nocov: require 'openssl' begin # Test cipher actually works cipher = OpenSSL::Cipher.new("aes-256-gcm") cipher.encrypt cipher.key = '1'*32 cipher_iv =...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/constraint_validations.rb
Ruby
mit
5,086
master
9,791
# frozen-string-literal: true module Sequel module Plugins # The constraint_validations plugin is designed to be used with databases # that used the constraint_validations extension when creating their # tables. The extension adds validation metadata for constraints created, # and this plugin reads ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/eager_each.rb
Ruby
mit
5,086
master
3,245
# frozen-string-literal: true module Sequel module Plugins # The eager_each plugin makes calling each on an eager loaded dataset do eager loading. # By default, each does not work on an eager loaded dataset, because each iterates # over rows of the dataset as they come in, and to eagerly load you need to...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/boolean_readers.rb
Ruby
mit
5,086
master
2,477
# frozen-string-literal: true module Sequel module Plugins # The boolean_readers plugin allows for the creation of attribute? methods # for boolean columns, which provides a nicer API. By default, the accessors # are created for all columns of type :boolean. However, you can provide a # block to th...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/association_pks.rb
Ruby
mit
5,086
master
12,356
# frozen-string-literal: true module Sequel module Plugins # The association_pks plugin adds association_pks, association_pks=, and # association_pks_dataset instance methods to the model class for each # one_to_many and many_to_many association added. These methods allow for # easily returning the ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/tree.rb
Ruby
mit
5,086
master
6,146
# frozen-string-literal: true module Sequel module Plugins # The tree plugin adds additional associations and methods that allow you to # treat a Model as a tree. # # A column for holding the parent key is required and is :parent_id by default. # This may be overridden by passing column name...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/error_splitter.rb
Ruby
mit
5,086
master
1,854
# frozen-string-literal: true module Sequel module Plugins # The error_splitter plugin automatically splits errors entries related to # multiple columns to have separate error entries, one per column. For example, # a multiple column uniqueness entry: # # validates_unique([:artist_id, :name]) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/pg_xmin_optimistic_locking.rb
Ruby
mit
5,086
master
3,685
# frozen-string-literal: true module Sequel module Plugins # This plugin implements optimistic locking mechanism on PostgreSQL based # on the xmin of the row. The xmin system column is automatically set to # the current transaction id whenever the row is inserted or updated: # # class Person <...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/optimistic_locking_base.rb
Ruby
mit
5,086
master
1,575
# frozen-string-literal: true module Sequel module Plugins # Base for other optimistic locking plugins module OptimisticLockingBase # Load the instance_filters plugin into the model. def self.apply(model) model.plugin :instance_filters end module ClassMethods # The co...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/insert_conflict.rb
Ruby
mit
5,086
master
2,552
# frozen-string-literal: true module Sequel module Plugins # The insert_conflict plugin allows handling conflicts due to unique # constraints when saving new model instance, using the INSERT ON CONFLICT # support in PostgreSQL 9.5+ and SQLite 3.24.0+. Example: # # class Album < Sequel::Model ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/csv_serializer.rb
Ruby
mit
5,086
master
6,918
# frozen-string-literal: true require 'csv' module Sequel module Plugins # csv_serializer handles serializing entire Sequel::Model objects to CSV, # as well as support for deserializing CSV directly into Sequel::Model # objects. It requires the csv standard library. # # Basic Example: # ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/validate_associated.rb
Ruby
mit
5,086
master
2,983
# frozen-string-literal: true module Sequel module Plugins # The validate_associated plugin allows you to validate associated # objects. It also offers the ability to delay the validation of # associated objects until the current object is validated. # If the associated object is invalid, validation...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/defaults_setter.rb
Ruby
mit
5,086
master
5,214
# frozen-string-literal: true require 'delegate' module Sequel module Plugins # The defaults_setter plugin makes the column getter methods return the default # values for new objects, if the values have not already been set. Example: # # # column a default NULL # # column b default 2 # ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/auto_validations.rb
Ruby
mit
5,086
master
13,257
# frozen-string-literal: true module Sequel module Plugins # The auto_validations plugin automatically sets up the following types of validations # for your model columns: # # 1. type validations for all columns # 2. not_null validations on NOT NULL columns (optionally, presence validations) ...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/instance_specific_default.rb
Ruby
mit
5,086
master
4,976
# frozen-string-literal: true module Sequel module Plugins # The instance_specific_default plugin exists to make it easier to use a # global :instance_specific association option, or to warn or raise when Sequel # has to guess which value to use :instance_specific option (Sequel defaults to # guessin...
github
jeremyevans/sequel
https://github.com/jeremyevans/sequel
lib/sequel/plugins/validation_helpers.rb
Ruby
mit
5,086
master
17,067
# frozen-string-literal: true module Sequel module Plugins # The validation_helpers plugin contains validate_* methods designed to be called inside Model#validate # to perform validations: # # Sequel::Model.plugin :validation_helpers # class Album < Sequel::Model # def validate # ...