Git Product home page Git Product logo

atom-build-oracle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fuzziebrain 4223

atom-build-oracle's Issues

Errors with latest update

sed: 1: "/Users/giffy/.atom/pack ...": extra characters at the end of g command
Script took longer than expected
cat: /Users/giffy/.atom/packages/build-oracle/tmp/spooledCompilation.txt: No such file or directory

Setting: using sqlcl

Uncaught TypeError: Cannot read property 'path' of null

Steps to reproduce:

  1. Open a new file and keep it untitled;
  2. Put inside of it a valid plsql statement;
  3. Build.

Atom: 1.14.3 x64
Electron: 1.3.13
OS: Microsoft Windows 7 Enterprise
Thrown From: build-oracle package 1.5.2

Stack Trace

Uncaught TypeError: Cannot read property 'path' of null

At ~\.atom\packages\build-oracle\lib\make.js:104

TypeError: Cannot read property 'path' of null
    at doMatch (/packages/build-oracle/lib/make.js:104:83)
    at /packages/build/lib/error-matcher.js:74:52
    at Array.forEach (native)
    at ErrorMatcher._parse (/packages/build/lib/error-matcher.js:73:38)
    at ErrorMatcher.set (/packages/build/lib/error-matcher.js:131:10)
    at /packages/build/lib/build.js:189:27)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at ChildProcess.cp.emit (/packages/build/node_modules/cross-spawn/lib/enoent.js:40:29)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Commands

     -0:55.7.0 core:copy (input.hidden-input)
     -0:55.3.0 application:new-file (input.hidden-input)
     -0:54.7.0 core:paste (input.hidden-input)
     -0:44.7.0 grammar-selector:show (input.hidden-input)
     -0:42.5.0 core:confirm (input.hidden-input)
     -0:41.3.0 build:select-active-target (input.hidden-input)
     -0:00.9.0 build:toggle-panel (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Non-Core Packages

angularjs 0.4.0 
atom-beautify 0.29.17 
atom-bootstrap3 1.2.12 
auto-indent 0.5.0 
autoclose-html 0.23.0 
autocomplete-abl 0.1.2 
autocomplete-oracle 0.4.0 
build 0.67.0 
build-cmd 0.5.0 
build-oracle 1.5.2 
busy 0.7.0 
ex-mode 0.13.1 
highlight-selected 0.12.0 
language-abap 1.1.0 
language-abl 0.10.1 
language-batchfile 0.5.2 
language-oracle 1.6.2 
linter 1.11.23 
linter-bootlint 1.0.4 
linter-javac 1.9.4 
linter-jshint 3.0.2 
linter-jsonlint 1.3.0 
linter-pylint 1.2.2 
minimap 4.26.8 
minimap-linter 1.6.0 
open-recent 5.0.0 
scroll-sync 0.1.5 
sort-lines 0.14.0 
split-diff 1.2.0 
tab-title 0.3.3 
vim-mode-plus 0.82.3 
vim-mode-plus-ex-mode 0.8.1 
word-jumper 0.3.0 
xml-formatter 0.10.0 

TNS Names support

Would be nice if there were an option to use an existing tnsnames.ora file

Compiling views errors

This fails

  • /*+ materialize */ hint
  • empty line between from and join
create or replace force view vincent as
with something as (
    select /*+ materialize */ 1 id
    from dual
)
select 1 id
from dual d

join something s
on 1 = 1;

This works

  • NO /*+ materialize */ hint
  • empty line between from and join
create or replace force view vincent as
with something as (
    select 1 id
    from dual
)
select 1 id
from dual d

join something s
on 1 = 1;

This works

  • /*+ materialize */ hint
  • NO empty line between from and join
create or replace force view vincent as
with something as (
    select /*+ materialize */ 1 id
    from dual
)
select 1 id
from dual d
join something s
on 1 = 1;

Somehow the combination of the hint and the empty line fails the compilation.

Use FIFO for SQLcl

SQLcl is a java app, and as such firing up the jvm each time takes a lot of time compared to SQL*Plus. One way around this is to use a named pipe so that SQLcl is always running in the background.

pipes

Windows support

Currently being developed on Linux, which should largely work for OS X.

Will need to cater for windows (no /bin/bash unless on cygwin)

Idea: Reset to the default target postBuild

Scenario: 3 build targets, dev, test, prod.

Most of the time, the workflow will be primarily building against dev, once everything is perfected, run against test and finally prod.

When using keyboard bindings to build (ctrl+alt+b), it may not be immediately apparent you are still active on the prod target.

I think it would be handy if after a build, it immediately reset to the default build target. If this is possible with the build provider, this could/should be a configuration in the settings.

Charset issue

Not sure if this is related to atom-build-oracle, but I am having a character set issue.

When writing french accents in Atom (UTF-8):

image

It gets changed in the database. SQL developer is also set to UTF-8.

image

Database itself is also set to UTF-8:

image

Any thoughts?

Running files on relative paths

My structure looks like:

  • [root]
    • .atom-build-oracle.json
    • [packages]
      • vd_utils.pks
      • vd_utils.pkb
    • [release]
      • release.sql

The release contains release.sql which calls something in the packages folder:

prompt PACKAGES
@..\packages\vd_util.pks
@..\packages\vd_util.pkb

Result is:

SP2-0310: unable to open file "..\packages\vd_util.pks"
SP2-0310: unable to open file "..\packages\vd_util.pkb"

So it appears that any script atom-build-oracle runs is treated like it's on the root folder, so we can't use relative paths.


Test case: the following code works (as if release.sql is in the root folder).

prompt PACKAGES
@packages\vd_util.pks
@packages\vd_util.pkb

Help Setup SQLPLUS Oracle XE

Hello, i Need help in setup this package to Oracle-Xe, but i am new working with database, that some options like needed i can not successfully fill with the correct params.

now date is wrapped in sqlcl and not in sqlplus

eg.

sqlcl:

MY_USER              DB                   NOW                               
-------------------- -------------------- -----------------------------------
HR                   XE                   26/NOV/15 12:45:43.093359000 PM +11
                                          :00               

sqlplus:

MY_USER              DB                   NOW
-------------------- -------------------- -----------------------------------
HR                   XE                   26-NOV-15 12.47.35.705682 PM +11:00

Clear errors in SQLcl

Errors don't seem to be cleared between connections:

trent@birroth:~$ sql /nolog

SQLcl: Release 4.2.0.15.296.0549 RC on Sun Nov 29 12:21:42 2015

Copyright (c) 1982, 2015, Oracle.  All rights reserved.


SQL> conn hr/[email protected]/xe

Connected

SQL> create or replace package foo
  2  as
  3  l_nn NUMBER := 22;comment will force an error
  4  end foo;
  5  /


Package FOO compiled

Errors: check compiler log
SQL> sho err

Errors for PACKAGE HR.FOO:

LINE/COL ERROR
-------- ------------------------------------------------------------------------------
3/32     PLS-00103: Encountered the symbol "FORCE" when expecting one of the following:

         := . ( @ % ; not null range default character

SQL> disconnect

Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> conn hr/[email protected]/xe

Connected

SQL> sho err

Errors for PACKAGE HR.FOO:

LINE/COL ERROR
-------- ------------------------------------------------------------------------------
3/32     PLS-00103: Encountered the symbol "FORCE" when expecting one of the following:

         := . ( @ % ; not null range default character

SQL>

Error installing dependencies

Getting the following error when installing this package in a new environment.

C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\view.js:18 Uncaught (in promise) TypeError: this.notificationView.querySelector is not a function
    at new View (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\view.js:18:43)
    at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:10:18
    at next (<anonymous>)
    at step (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:273)
    at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:443
    at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:99
    at installDependencies (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:34:16)
    at Object.<anonymous> (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\index.js:23:46)
    at next (<anonymous>)
    at step (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\index.js:34:273)

Missing Settings button

The documentation screenshots reference a the Settings for this package. There is no settings button for this package.

image

Document required variables for SQL*Plus

The original post I got this idea from - http://wphilltech.com/sublime-text-for-oracle-apex-developers/ - mentioned about some variables that need to be set - which seem specific to OS X.

# set PATHXX /bin:/sbin:/usr/bin:/usr/sbin:/Volumes/Daten/Users/oracle/instantclient
# set SQLPATH /Applications/instantclient_10_2
# set DYLD_LIBRARY_PATH /Applications/instantclient_10_2
# set TNS_ADMIN /Applications/instantclient_10_2/network/admin

Find a way to test and document this stuff

Support for multiple connection strings

Idea for an upcoming version: supporting multiple connection strings. If multiple connection strings are available, user would have to choose which one to use.

.atom-build-oracle.json example:

[
    {
        "targetName" : "hr: dev",
        "connectString" : "hr/hr@XE1"
    },
    {
        "targetName" : "hr: test",
        "connectString" : "hr/hr@XE2"
    }
]

Thoughts?

Idea: Exit on error

Suppose I have two blocks in the script I'm compiling, and the first block throws an error - I'm inclined to think the script shouldn't continue running.

Consider the following:

begin
    dbms_output.put_line('Running block one');
    raise_application_error(-20000, 'Error');
end;
/

begin

    dbms_output.put_line('Should this be reached? Initial thoughts, no');

end;
/

Will output,

Compiling script: /home/trent/Projects/PureMigration/test.sql
 
Running block one

begin
*
ERROR at line 1:
ORA-20000: Error
ORA-06512: at line 3
 
 
Should this be reached? Initial thoughts, no
 
PL/SQL procedure successfully completed.
 
No errors.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

By adding whenever sqlerror exit, we can avoid ever reaching that second block of code - which I feel makes the most sense.

Compiling script: /home/trent/Projects/PureMigration/test.sql
 
Running block one
begin
*
ERROR at line 1:
ORA-20000: Error
ORA-06512: at line 3

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

TypeError when only specifying connectString

Cannot read property 'toString' of undefined

TypeError: Cannot read property 'toString' of undefined
    at OracleBuildConfig.settings (/home/trent/.atom/packages/build-oracle/lib/make.js:52:46)
    at /home/trent/.atom/packages/build/lib/target-manager.js:75:30

SP2-0042: unknown command, when blank lines

Example 1:

view.sql:

CREATE OR REPLACE VIEW "HR"."V_VIEW_SAMPLE" as
select

    dbms_random.string('U', 12) str
from dual;

Output:

Database connection information

MY_USER              DB              NOW
-------------------- --------------- ----------------------------------------
HR                   XE              31-AUG-16 06.33.31.955862 PM -04:00


Compiling script: /home/trent/Projects/build-oracle/samples/view3.sql

SP2-0734: unknown command beginning "dbms_rando..." - rest of line ignored.
SP2-0042: unknown command "from dual" - rest of line ignored.

Example 2

tbl.sql:

create table x(

n number
);

Output:

Database connection information

MY_USER              DB              NOW
-------------------- --------------- ----------------------------------------
HR                   XE              31-AUG-16 06.35.38.309446 PM -04:00


Compiling script: /home/trent/Projects/build-oracle/samples/tbl1.sql

SP2-0042: unknown command "n number" - rest of line ignored.
SP2-0042: unknown command ")" - rest of line ignored.

Both are resolved by removing blank lines.

Specifically for SQL*Plus.

Path missing those specified in .bashrc

My path in .bashrc has: export PATH=$PATH:$GOPATH/bin:/opt/sqlcl/bin

When I run the code in Atom:

cp = require('child_process')
cp.exec "echo $PATH > /tmp/pathFromAtom.txt"

This file does not contain those last 2 entries.

Getting "No configuration to build this project exist" error

I am trying to use sqlplus to connect to my Oracle database. When running SQLPlus from command line it works. I created the .atom-build-oracle.JSON file with the settings per your instructions. I also have "build" package installed. When I try to execute a query by pushing F9, I get the error "No configuration to build this project exist". Do I need to add something else in my .atom-build-oracle.JSON file? Any help would be appreciated. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.