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 +4 -4
- data/.github/workflows/ci.yml +19 -0
- data/README.md +11 -6
- data/docker-compose.yml +2 -2
- data/lib/scenic/adapters/oracle.rb +2 -2
- data/lib/scenic/oracle_adapter/version.rb +1 -1
- metadata +3 -6
- data/.travis.yml +0 -42
- data/.travis/oracle/download.sh +0 -14
- data/.travis/oracle/install.sh +0 -33
- data/.travis/setup_accounts.sh +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a6654ada5f4a3b75d1a5539be516cbd673f9db9d19a267984d0262ad0909a4d
|
4
|
+
data.tar.gz: 306b5811810f316b451312e5a86428469fa2348fcf9ef3a13a1503519b9c4e2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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://
|
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
|
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
|
29
|
+
While you can use any Oracle instance for development, it's easiest to use Docker and docker-compose.
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
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
@@ -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)
|
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
|
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-
|
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
|
data/.travis/oracle/download.sh
DELETED
@@ -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}"
|
data/.travis/oracle/install.sh
DELETED
@@ -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
|
data/.travis/setup_accounts.sh
DELETED
@@ -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
|