Sha256: 4774e93c8fff0f0cf78a8479b9caaea4993a0aad57073afe4153ec2c4df431d7
Contents?: true
Size: 552 Bytes
Versions: 5
Compression:
Stored size: 552 Bytes
Contents
module SchemaPlus::Views module ActiveRecord module ConnectionAdapters module Sqlite3Adapter def views(name = nil) execute("SELECT name FROM sqlite_master WHERE type='view'", name).collect{|row| row["name"]} end def view_definition(view_name, name = nil) sql = execute("SELECT sql FROM sqlite_master WHERE type='view' AND name=#{quote(view_name)}", name).collect{|row| row["sql"]}.first sql.sub(/^CREATE VIEW \S* AS\s+/im, '') unless sql.nil? end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems