scenic-oracle_adapter 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14a2bb464c3db08affd1e259915183d9c8782fd59bc0f9db42545b00a52035cc
4
- data.tar.gz: 8451d766685d27b4f69b8e6724dd5c6cdb1656721ee681f37d40c5f47e956191
3
+ metadata.gz: 2a6654ada5f4a3b75d1a5539be516cbd673f9db9d19a267984d0262ad0909a4d
4
+ data.tar.gz: 306b5811810f316b451312e5a86428469fa2348fcf9ef3a13a1503519b9c4e2d
5
5
  SHA512:
6
- metadata.gz: ed7a964686b52f08fbafeb1f66fb5f8660897d0cb8af97c1de5f8dd60bb29f50ac8b330640db0483f8d2a78a6e295ce90f8b35ea818d08eab13c499fe74ee3b2
7
- data.tar.gz: 3caf7952fd0bcb67864520933ec263f3b9d96ebd8549045ad3c30e86303152fc959b3e907550dff10882b7d06f1cd1bf66d3f319932d9e1d7ed6678fd18335a4
6
+ metadata.gz: 918aa48ce7550cc4452c60bef6690661ddf09ad1a54f64ede2d523063b182fbe1ab807d300b9f31b212add47d87b952098ce362334f42a34b56c4a4dbb60f2af
7
+ data.tar.gz: 57c3671d477de89604300cf17462cf411f63b8b465cfd923d3bfefee44be82ff871cc967292b91f6ec1fcac2630ebcb5e6f81e4894541400e931ea6c6127ba2c
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+
7
+ build:
8
+
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Login to Docker Hub
14
+ uses: docker/login-action@v1
15
+ with:
16
+ username: ${{ secrets.DOCKER_HUB_USERNAME }}
17
+ password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
18
+ - name: Run tests
19
+ run: docker-compose run gem rspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # scenic-oracle_adapter [![Build Status](https://travis-ci.org/cdinger/scenic-oracle_adapter.svg?branch=master)](https://travis-ci.org/cdinger/scenic-oracle_adapter)
1
+ # scenic-oracle_adapter [![Build Status](https://github.com/cdinger/scenic-oracle_adapter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/cdinger/scenic-oracle_adapter/actions/workflows/ci.yml?query=branch%3Amaster)
2
2
 
3
- An Oracle adapter for Thoughtbot's [scenic](https://github.com/thoughtbot/scenic) rubygem.
3
+ An Oracle adapter for the [scenic](https://github.com/scenic-views/scenic) rubygem.
4
4
 
5
5
  ## Installation
6
6
 
@@ -26,11 +26,16 @@ end
26
26
 
27
27
  ## Development
28
28
 
29
- While you can use any Oracle instance to run the test suite, it's easiest to use Docker and docker-compose.
29
+ While you can use any Oracle instance for development, it's easiest to use Docker and docker-compose.
30
30
 
31
- After checking out the repo, start the Oracle instance by running `docker-compose up -d`. After that, you can
32
- run `docker-compose exec gem bin/setup` to install dependencies. Then, run `docker-compose exec gem bin/test` (or `rspec`) to run the tests.
33
- You can also run `docker-compose exec gem bin/console` for an interactive prompt that will allow you to experiment.
31
+ Note that the Oracle container takes up to two minutes to start and become available. If you're doing active development you probably want to start the containers in detached mode: `docker-compose up -d`. This starts everything in the background and allows you to use `docker-compose exec` to run commands on the already running containers:
32
+
33
+ - Run specs: `docker-compose exec gem bin/test`
34
+ - Open a console: `docker-compose exec gem bin/console`
35
+
36
+ ## Tests
37
+
38
+ If you just want to run the test suite you can use `docker-compose run --rm gem bin/test`. Again, because the Oracle container takes so long to start up, the first execution will take a while. The test suite will wait for the database container to become available. Subsequent executions will be faster.
34
39
 
35
40
  By default, the test suite will attempt to connect to a local docker Oracle instance (see `spec/spec_helper.rb` for connection details).
36
41
  You can override the database URL by supplying a value to the `DATABASE_URL` environment variable.
data/docker-compose.yml CHANGED
@@ -1,11 +1,11 @@
1
1
  version: '3'
2
2
  services:
3
3
  db:
4
- image: "container-registry.oracle.com/database/enterprise:12.2.0.1-slim"
4
+ image: store/oracle/database-enterprise:12.2.0.1
5
5
  volumes:
6
6
  - db:/ORCL
7
7
  ports:
8
- - "1521:1521"
8
+ - 1521:1521
9
9
  gem:
10
10
  build: .
11
11
  volumes:
@@ -32,8 +32,8 @@ module Scenic
32
32
  create_view(name, definition)
33
33
  end
34
34
 
35
- def create_materialized_view(name, definition)
36
- execute("create materialized view #{quote_table_name(name)} as #{definition}")
35
+ def create_materialized_view(name, definition, no_data: false)
36
+ execute("create materialized view #{quote_table_name(name)} #{'build deferred' if no_data} as #{definition}")
37
37
  end
38
38
 
39
39
  def update_materialized_view(name, definition)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Scenic
4
4
  module OracleAdapter
5
- VERSION = "1.0.3"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scenic-oracle_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Dinger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-22 00:00:00.000000000 Z
11
+ date: 2021-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scenic
@@ -115,13 +115,10 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/ci.yml"
118
119
  - ".gitignore"
119
120
  - ".rspec"
120
121
  - ".rubocop.yml"
121
- - ".travis.yml"
122
- - ".travis/oracle/download.sh"
123
- - ".travis/oracle/install.sh"
124
- - ".travis/setup_accounts.sh"
125
122
  - CODE_OF_CONDUCT.md
126
123
  - Dockerfile
127
124
  - Gemfile
data/.travis.yml DELETED
@@ -1,42 +0,0 @@
1
- ---
2
- dist: trusty
3
- sudo: required
4
- language: ruby
5
- cache: bundler
6
- rvm:
7
- - 2.5
8
- - 2.6
9
- - 2.7
10
-
11
- env:
12
- global:
13
- - ORACLE_FILE=oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip
14
- - ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
15
- - TNS_ADMIN=$ORACLE_HOME/network/admin
16
- - NLS_LANG=AMERICAN_AMERICA.AL32UTF8
17
- - ORACLE_BASE=/u01/app/oracle
18
- - LD_LIBRARY_PATH=$ORACLE_HOME/lib
19
- - PATH=$PATH:$ORACLE_HOME/jdbc/lib
20
- - DATABASE_VERSION=11.2.0.1
21
- - ORACLE_SID=XE
22
- - DATABASE_NAME=XE
23
- - DATABASE_URL="oracle-enhanced://scenic_oracle_adapter:scenic_oracle_adapter@localhost/xe:1521"
24
-
25
- before_install:
26
- - chmod +x .travis/oracle/download.sh
27
- - chmod +x .travis/oracle/install.sh
28
- - chmod +x .travis/setup_accounts.sh
29
- - gem install bundler -v 2.1.2
30
-
31
- install:
32
- - .travis/oracle/download.sh
33
- - .travis/oracle/install.sh
34
- - .travis/setup_accounts.sh
35
- - bundle install
36
-
37
- jobs:
38
- include:
39
- - stage: Static analysis
40
- script: bundle exec rubocop lib
41
- - stage: Test
42
- script: bundle exec rspec
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- cd "$(dirname "$(readlink -f "$0")")"
4
-
5
- deb_file=oracle-xe_11.2.0-1.0_amd64.deb
6
-
7
- git clone https://github.com/wnameless/docker-oracle-xe-11g.git
8
-
9
- cd docker-oracle-xe-11g/assets &&
10
- cat "${deb_file}aa" "${deb_file}ab" "${deb_file}ac" > "${deb_file}"
11
-
12
- pwd
13
-
14
- ls -lAh "${deb_file}"
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- [ -n "$ORACLE_FILE" ] || { echo "Missing ORACLE_FILE environment variable!"; exit 1; }
4
- [ -n "$ORACLE_HOME" ] || { echo "Missing ORACLE_HOME environment variable!"; exit 1; }
5
-
6
- cd "$(dirname "$(readlink -f "$0")")"
7
-
8
- ORACLE_DEB=docker-oracle-xe-11g/assets/oracle-xe_11.2.0-1.0_amd64.deb
9
-
10
- sudo apt-get -qq update
11
- sudo apt-get --no-install-recommends -qq install bc libaio1
12
-
13
- df -B1 /dev/shm | awk 'END { if ($1 != "shmfs" && $1 != "tmpfs" || $2 < 2147483648) exit 1 }' ||
14
- ( sudo rm -r /dev/shm && sudo mkdir /dev/shm && sudo mount -t tmpfs shmfs -o size=2G /dev/shm )
15
-
16
- test -f /sbin/chkconfig ||
17
- ( echo '#!/bin/sh' | sudo tee /sbin/chkconfig > /dev/null && sudo chmod u+x /sbin/chkconfig )
18
-
19
- test -d /var/lock/subsys || sudo mkdir /var/lock/subsys
20
-
21
- sudo dpkg -i "${ORACLE_DEB}"
22
-
23
- echo 'OS_AUTHENT_PREFIX=""' | sudo tee -a "$ORACLE_HOME/config/scripts/init.ora" > /dev/null
24
- echo 'disk_asynch_io=false' | sudo tee -a "$ORACLE_HOME/config/scripts/init.ora" > /dev/null
25
-
26
- sudo usermod -aG dba $USER
27
-
28
- ( echo ; echo ; echo travis ; echo travis ; echo n ) | sudo AWK='/usr/bin/awk' /etc/init.d/oracle-xe configure
29
-
30
- "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
31
- CREATE USER $USER IDENTIFIED EXTERNALLY;
32
- GRANT CONNECT, RESOURCE TO $USER;
33
- SQL
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -ev
4
-
5
- "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
6
- alter user sys identified by admin;
7
- alter user system identified by admin;
8
- alter database default tablespace USERS;
9
- CREATE USER scenic_oracle_adapter IDENTIFIED BY scenic_oracle_adapter;
10
- GRANT unlimited tablespace, create session, create table, create sequence,
11
- create procedure, create trigger, create view, create materialized view,
12
- create database link, create synonym, create type, ctxapp TO scenic_oracle_adapter;
13
- exit
14
- SQL