Sha256: 2b22351770933a1a241bf332bbcb7ec6702e581ac56601bb5fe30cb87dab4e26
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
#!/usr/bin/env ruby $:.unshift(File.expand_path("../lib", __dir__)) # require "bundler/setup" # Bundler.require :development require "activerecord-cockroachdb-adapter" # This allows playing with the rake task as well. Ex: # # ActiveRecord::Tasks::DatabaseTasks. # structure_load(Post.connection_db_config, "awesome-file.sql") require "active_record/connection_adapters/cockroachdb/database_tasks" schema_kind = ENV.fetch("SCHEMA_KIND", ENV.fetch("SCHEMA", "default")) system("cockroach sql --insecure --host=localhost:26257 --execute='drop database if exists ar_crdb_console'", exception: true) system("cockroach sql --insecure --host=localhost:26257 --execute='create database ar_crdb_console'", exception: true) ActiveRecord::Base.establish_connection( #Alternative version: "cockroachdb://root@localhost:26257/ar_crdb_console" adapter: "cockroachdb", host: "localhost", port: 26257, user: "root", database: "ar_crdb_console" ) load "#{__dir__}/console_schemas/#{schema_kind}.rb" require "irb" IRB.start(__FILE__)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activerecord-cockroachdb-adapter-7.2.0 | bin/console |