Giter Club home page Giter Club logo

oradew-vscode's Introduction

Oradew - Oracle (PL/SQL) Development Workspace

Build Status

This extension enables you to develop your Oracle (PL/SQL) project in Visual Studio Code. It enables you to:

  • Manage PL/SQL source code with version control (Git)
  • Compile files and Run statements with ORA errors problem matching
  • Package files into a single SQL deployment script
  • Deploy to multiple environments in one click

Compile Demo

Installation

Install the extension and start with Oradew: Initialize Workspace command.

Prerequisites (local)

  • Node.js 14.6, or later
  • Git
  • SQL*Plus or SQLcl

Container

An Oradew VS Code development container is available here with all prerequisites preinstalled.

Workspace

A default workspace structure:

./deploy                Deployment package
./scripts               SQL Scripts (DDL, DML, files, etc)
./src                   Source with PL/SQL objects
./test                  Unit tests
dbconfig.json           DB environment configuration (required)
oradewrc.json           Workspace configuration

Commands

Basic Workflow

Setup

  • Initialize Workspace - Create configuration files (dbconfig.json and oradewrc.json) and a clean workspace structure
  • Create Source from DB - Create Source files from existing DB objects

Build

  • Compile Changed Files (F6) - Compile changed Source files in working tree to DB
  • Compile Current File - Compile Source object (or any file with a single SQL or PL/SQL statement)
  • Run Current File as Script (F5) - Execute a SQL script (with SQL*Plus or SQLcl)
  • Run Current Statement (Ctrl+Enter) - Execute a SQL query or PL/SQL statement with autoCommit and dbms_output enabled

Install

  • Package (F9) - Generate a deployment script from project files
  • Deploy... - Run deployment script on the selected environment (with SQL*Plus or SQLcl)

Additional

  • Import Source (Shift+F6) - Walk Source files and import matching DB object from DB
  • Import Current File - Import matching DB object
  • Import Selected Object - Import new object from DB into a Source file
  • Compile Source - Walk Source files and compile each file to DB
  • Toggle Compile Watch - Start/End compilaton on save. Compile working tree automatically whenever a Source file changes.
  • Package Delta (Shift+F9) - Package current version changes. Command extracts changed file paths from Git history - starting from latest tagged commit (last version) up to the last commit (HEAD)
  • Run tests - Compile unit test files
  • Generate... Generate PL/SQL code with a code generator

Switch environment

  • Set DB Environment - Set DB environment that will be used when executing commands. Pick list is generated from dbconfig.json. The default value is DEV.
  • Clear DB Environment - Set DB environment to <None>. This means that you choose DB environment every time you execute DB command.

Switch user

  • Set DB User - Set DB user that will be used when executing commands. Pick list is generated from dbconfig.json. The default value is <Auto> (user extracted from file path).

Configuration

DB environment

Only dbconfig.json file is required for the workspace activation and successful connection with your database. Multiple DB environments with multi-users per environment are supported.

You can create dbconfig.json manually in the root folder of your workspace or execute Init Workspace command.

A minimal example with DEV environment and a single schema-user follows:

{
  "DEV": {
    "connectString": "localhost/orclpdb",
    "users": [{ "user": "hr", "password": "welcome" }]
  }
}

For credentials stored in oracle wallets, or auto-login oracle wallets use "walletConnectString" instead of "password" property. (more info)

Workspace

Workspace supports a base configuration file (oradewrc.json) and an additional configuration file for each environment (oradewrc.DEV.json, oradewrc.TEST.json, etc.). The base configuration settings apply to all environments, unless an environment specific configuration file exists that extends the base.

Default values will be used in the case workspace configuration file is not present. The following settings are available (defaults):

{
  "compile.warnings": "NONE",
  "compile.force": true,
  "compile.stageFile": false,
  "source.input": ["./src/**/*.sql"],
  "source.encoding": "utf8",
  "source.pattern": {
    "packageSpec": "./src/{schema-name}/PACKAGES/{object-name}.sql",
    "packageBody": "./src/{schema-name}/PACKAGE_BODIES/{object-name}.sql",
    "trigger": "./src/{schema-name}/TRIGGERS/{object-name}.sql",
    "typeSpec": "./src/{schema-name}/TYPES/{object-name}.sql",
    "typeBody": "./src/{schema-name}/TYPE_BODIES/{object-name}.sql",
    "view": "./src/{schema-name}/VIEWS/{object-name}.sql",
    "function": "./src/{schema-name}/FUNCTIONS/{object-name}.sql",
    "procedure": "./src/{schema-name}/PROCEDURES/{object-name}.sql",
    "table": "./src/{schema-name}/TABLES/{object-name}.sql",
    "synonym": "./src/{schema-name}/SYNONYMS/{object-name}.sql",
    "apex": "./src/{schema-name}/APEX/{object-name}.sql"
  },
  "import.ease": false,
  "import.getDdlFunction": "dbms_metadata.get_ddl",
  "package.input": ["./scripts/**/initial*.sql", "./src/**/*.sql", "./scripts/**/final*.sql"],
  "package.exclude": ["./scripts/**/+(file|run)*.sql"],
  "package.output": "./deploy/{schema-name}.sql",
  "package.encoding": "utf8",
  "package.templating": false,
  "test.input": ["./test/**/*.test.sql"],
  "version.number": "0.0.1",
  "version.description": "New feature",
  "version.releaseDate": "2099-01-01"
}
  • compile.warnings - PL/SQL compilation warning scopes. The default value is NONE.
  • compile.force - Ignore conflict detection. If object you are compiling has changed on DB (has a different DDL timestamp), you are prevented from overriding the changes with a merge step. Resolve merge conflicts if necessary and than compile again. Set to false to turn on conflict detection. The default value is true.
  • compile.stageFile - Automatically stage file after succesfully compiled (git add). Default value is false.
  • source.input - Glob pattern for Source files. Used by general Compile, Import and Create command to match files that are targeted. For example, to compile only "HR" schema and exclude "HR" tables, set: ["./src/HR/**/*.sql", "!./src/HR/TABLES/*.sql"].
  • source.encoding - Encoding of Source files. (ex.: "utf8", "win1250", ...) The default value is utf8.
  • source.pattern - Define custom source structure by specifing mappings for different object types. Ommited object types won't get exported. Path variables {schema-name} can also be omitted. Single schema pck ex: {"packageSpec": "./src/pck/{object-name}-spec.sql", "packageBody": "./src/pck/{object-name}-body.sql"}
  • import.ease - When set to true, it will import only DB objects that changed on DB in comparision to project Source files. Default value is false.
  • import.getDdlFunction - Custom Get_DDL function name. Use your own DB function to customize import of object's DDL. It is used by Import commands. The default value is DBMS_METADATA.GET_DDL.
  • package.input - Array of globs for packaging files into deployment script file (package.output). Package Delta command populates it with changed file paths.
  • package.output - Deployment script file path. Script is created with Package command by bundling input Source files and Scripts; wrapped with "SPOOL log" and "COMMIT;". Path variable {schema-name} is used to group files by schema into separate scripts. It can be used anywhere in the path or omitted altogether.
  • package.exclude - Array of globs for excluding files from packaging. Scripts that start with "file" or "run" by default.
  • package.encoding - Encoding of deployment script file. (ex.: "utf8", "win1250", ...) The default value is utf8.
  • package.templating - Turn on templating of config variables. Use existing ('${config["version.releaseDate"]}') or declare a new variable in config file and than use it in your sql file. Variables are replaced with actual values during packaging. The default value is false.
  • test.input - Array of globs for matching test files. Executed with Run tests command.
  • version.number - Version number
  • version.description - Version description
  • version.releaseDate - Version release date

APEX applications compatibility

Minimum required APEX version is 5.1.4, otherwise APEX applications are not imported.

Code Generator

Write a PL/SQL function on database, add a definition to configuration file (oradewrc-generate.json) and then use Generate... command to execute your generator. A new file with the generated content will be created in your workspace.

Function specificaton

The generator function on DB has to have the following specification (parameters):

FUNCTION updateStatement(
  object_type IN VARCHAR2,    -- derived from path of currently open ${file}
  name IN VARCHAR2,           -- derived from path of currently open ${file}
  schema IN VARCHAR2,         -- derived from path of currently open ${file}
  selected_object IN VARCHAR2 -- ${selectedText} in editor
) RETURN CLOB;

Function parameters are derived from currently opened file and selected text in your editor when the generator is executed. The first three parameters (object_type, name, schema) are deconstructed from the path of the currently opened ${file} as ./src/${schema}/${object_type}/${name}.sql, whereas selected_object is the currently ${selectedText} in editor.

Generator definition

Create a configuration file oradewrc-generate.json in your workspace root with a definiton:

  "generator.define": [
    {
      "label": "Update Statement",
      "function": "utl_generate.updateStatement",
      "description": "Generate update statement for a table"
    }
  ]

The label and function properties are required for a generator to be succesfully defined (description is optional). Use output property to specify a file path of the generated content (also optional). If the output is omitted a file with unique filename will be created in ./scripts directory.

NOTE: Generators have a separate repository over here: Oradew Code Generators. Your contributions are welcomed!

Command Line

You can execute Oradew commands from the command line (Oradew CLI).

Installation

# From the extension folder %USERPROFILE%/.vscode/extensions/mp.oradew-vscode-...
> npm run install-cli

This will install oradew CLI command.

If you are installing from the repository you must first compile the source code:

> git clone https://github.com/mickeypearce/oradew-vscode
> npm start && npm run install-cli

Usage

# (Use `oradew <command> --help` for command options.)
> oradew --help
Usage: oradew <command> [options]

Commands:
  init [options]            Initialize a new workspace
  create [options]          Create Source files from DB objects
  compile [options]         Compile Source files to DB
  import [options]          Import Source files from DB
  package [options]         Package files to deployment script
  deploy|run [options]      Run script (with SQL*Plus or SQLcl)
  test [options]            Run unit tests
  generate [options]        Code generator
  watch [options]           Compile when Source file changes

Example

# Create simple dbconfig file and run "Hello World" on DEV environment
> echo {"DEV": {"connectString": "localhost/orclpdb", "users": [{"user": "hr", "password": "welcome"}]}} > dbconfig.json
> oradew compile --object "select 'world' as hello from dual"

# Simple Dev Workflow
> oradew watch
> oradew package
> oradew deploy --env TEST

Aditional information

How-tos

oradew-vscode's People

Contributors

dependabot[bot] avatar mickeypearce avatar mlipanje avatar yevon avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oradew-vscode's Issues

Multi- Schema - Create source from DB

Hi, how are you?
First of all i need to congratulate you for the great job developing this one, its awsome!

So, i have multiples schemas where i want to control, but, when a use de command Create source from DB only extract the objects from user DEV. I already tried to change the env and the user but its not effective.

I already read Add multi-schema support

Windows support?

When trying to Initialize Workspace/Version I am running into those Problems on my Windows 10 machine:

  • When having a space in the folder path it wont work
  • After fixing the path to have no spaces in it, I'm getting the following error:
> Executing task in folder Oradew_Test: c:\VSCode\data\extensions\mp.oradew-vscode-0.1.0\out\gulp.cmd --cwd \\wacker.corp\user\koellex001\Data\Oradew_Test --gulpfile c:\VSCode\data\extensions\mp.oradew-vscode-0.1.0\out\gulpfile.js --color true --silent true initProject <

Der Befehl "node" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
The terminal process terminated with exit code: 1
(translated: command "node" is wrong or could not be found)
  • When trying to use "npm rebuild" it also doesnt find that command

I haven't worked with Linux systems before but it sounds like these errors are all because I'm running windows and these commands are not there by default.

Wrong encoding after import sources.

I've tried to import all source from db, but i can't change the encoding of imported files. My db encoding is WIN1250 whereas Imported files are encoded in UTF8. How to change it? Property "package.encoding" doesn't change anything in this case.

Windows econding UTF8 problem

Hi,
I have a package that if I run as a script (f5) does not give errors.
If I only run the final part (Run Selected statement) of the package, where the grants are, I get errors.

image

image

I have similar errors if I don't set the correct econding (utf-8)

Generating a source from a database

I'm trying to generate a source from a database. Unfortunately, although the database has objects, none is downloaded and saved to the source. Have output like:
[13:05:36] Using gulpfile c:\Users\rpietka.vscode\extensions\mp.oradew-vscode-0.3.29\dist\gulpfile.js
[13:05:36] Starting 'create'...
[13:05:36] Starting 'createSrcFromDbObjects'...
[13:05:36] Finished 'create' after 18 ms
[13:05:36] Finished 'createSrcFromDbObjects' after 18 ms
[13:05:36] Starting ''...
[13:05:36] Finished '' after 68 ms

Maybe I should set up something extra to make the import work

Externalize gulp script and provide better documentation on its usage

I would like to use the gulp script outside of the vscode extension.

Would it be possible to publish an Azure DevOps Plugin as well as a vscode extension.

There are a number of use cases this would enable for me.

  • Automating the creation of multiple git based oradew database projects
  • Implementing a devops pipeline for deployment of oracle databases
  • Implementing a system that monitors development databases for changes and stores them in source control

@mickeypearce Love your extension btw, great job filling the gaping hole of opensource oracle development tooling.

Problems with uppercase file extensions using Windows

Unfortunately we have almost any sql-source in our repository with an uppercased File-Extention, e.g. MYPACKAGE-body.SQL.
Because of this I don't see the "Run Current File As Script (F5)" Button. I can't find even no way to configure this with something like
"source.input": ["./**/*.SQL"]

I'm using VSCode 1.46.1 under Windows 10

Catalina upgrade causes error on task compiler

I can't run the task runner to compile files after upgrading to Catalina.

image

I was getting this error everywhere before but re-installing SQLPlus has resolved it everywhere else e.g. in the terminal.
So, it is correctly set in my profile as the terminal in VS code works (below screenshot).

image

Hopefully this is something as simple as permissions somewhere in the extensions that need to run external libraries (Catalina has enforced a lot of other permissions) but I'm a little lost with finding a solution.

Displaying umlauts in terminal output

I've got a similar problem.

I use just a simple Script for testing, stored with win-1252 encoding:

COLUMN parameter FORMAT A20
COLUMN value FORMAT A20
SELECT * FROM V$NLS_PARAMETERS
WHERE parameter IN ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
SELECT USERENV('LANGUAGE') FROM dual;
SELECT 'ÄÖÜ-äöüß-€' AS umlaute FROM DUAL;

grafik

In oradewrc.json I have
"source.encoding": "win1252",

and in settings.json:

	"files.encoding": "windows1252",
	"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
	"terminal.integrated.shellArgs.windows": "/k chcp 1252",
	"oradew.envVariables": {
		"NLS_LANG": "GERMAN_GERMANY.WE8MSWIN1252"
	}

When I Show NLS_LANG in Dos-Shell:

Z:\>echo %NLS_LANG%
AMERICAN_AMERICA.we8mswin1252

When I use sqlplus.exe in the vscode-Terminal, everything is fine:
grafik

What can I do?

Originally posted by @true-hb in #48 (comment)

Oracle wallet authentication compatibility, userless & passwordless

Within sqlplus or sqlcl you can setup userless and passwordless authentication if you have an auto-login wallet in your oracle_home directory. I don't see any way to setup this kind of db connections with oradew. Passwordless login works like this:

  1. Create oracle wallet with mkstore and autologin:

  2. wallet create -wallet "C:\Oracle\oracle_home\network\admin" -pwd "PASSWORD" -auto_login_local

  3. Setup your tnsnames.ora as normal:

TNS_CONNECTION_NAME=
(description=
(address_list=
(address = (protocol = TCP)(host = yourhost)(port = yourport))
)
(connect_data =
(service_name=yourservicename)
)
)

  1. Add an auto login credential to the wallet
    mkstore -wrl "C:\Oracle\oracle_home\network\admin" -createCredential TNS_CONNECTION_NAME USER_NAME PASSWORD

  2. Then you can connect with sqlplus just with this command:
    sqlplus /@TNS_CONNECTION_NAME

Is there a way to allow setup db configs without specifying user and password and just set up multiple connection strings for every environment? Users is mandatory, and I've tried not specifying any password but it asks me for the password when executing import objects from db.

DB config connection looks like this
{
"DEV":{
"connectString":"TNS_CONNECTION_NAME",
"users":[
{
"user": "?????"
, "password":"?????"
, "schemas":["USER_NAME"]
, "askForPassword": false
}
]
}
}

It would be nice having compatibility with config like this, making connectString at user level and user and password not required:

{
"DEV":{
"users":[
{
"connectString":"TNS_CONNECTION_NAME"
, "schemas":["SCHEMA_NAME"]
},
{
"connectString":"TNS_CONNECTION_NAME_2"
, "schemas":["SCHEMA_NAME_2"]
}
]
}
}

I could look into it, but I really haven't found where is the sql or sqlcl command built, any ideas where shoud I look at?

Synonyms not being managed

Hello there,

I was checking your tool and I realised synonyms script are not created and seems not to be managed by the tool. Is this something not implemented yet or maybe something wrong going on on my installation?

Many thanks,
Juanma

Update node-oracledb version.

When installing on Windows with
node-v10.15.1-x64.msi and
instantclient-basiclite-windows.x64-18.3.0.0.0dbru.zip

npm rebuild fails with a download error.

Can you please update the node-oracledb dependency to 3.1 which I believe fixes the download issue?

Thanks,
Jason

Initialize Workspace not working

Hi,

when using "Initialize Workspace" in an empty folder I'm prompted to create a task.json with default options. What am I doing wrong?
See screen recording...
screen-rec-rdp

Thank you

Support for different configs per environment

Would like to pass different template variables per environment in to the scripts.

My use case is for a custom SEND_MAIL package.

v_email_server VARCHAR2(30) := '${config["version.number"]}';

Compile error "ERROR ORA-06550: line 3, column 40:"

When I compile anything (package, package body, view, table, triger...), I always have this error. Always on the same line, even if there is a comment on a couple of lines.
When i run the file as script (F5) always it success
Success => USER@DATABASE script.sql
=============================== STDOUT ===============================
2
But nothing will be created / modified on the database.

Terminal output problem matcher

Hi,
is it possible to customize the terminal output when I run some package or script? Errors and warnings risk not being detected:
image

problem matcher?
I'm using Run Current File as Script (F5)

Thanks

Problem importing when object has "SQL" in the name

Importing objects fail when the object contains "SQL" somewhere in the name. In a concrete example, let's imagine a FUNCTION named "UpdateMysqlFromOracle". When trying to import that function (doesn't matter if via Create source from DB or Import current file) the following error appears:

[16:03:45] Starting 'import'...
ORA-31603: object "UPDATEMFROMORACLE" of type FUNCTION not found in schema "SCHEMA_NAME"
ORA-06512: at "SYS.DBMS_METADATA", line 6731
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 6718
ORA-06512: at "SYS.DBMS_METADATA", line 9734
ORA-06512: at line 1
[16:03:46] Finished 'import' after 965 ms

Notice that from MYSQL, YSQL is stripped from the name while the M remains.

Happens with all procedures and functions that follow a similar pattern.

I think the problem is caused in this section of the extension's code:

(v) => new RegExp(v.replace("{schema-name}", "\\w+"), "gi")

More precisely, the .sql portion of the pattern is matched against MySQL and ends up getting stripped.

Error when initializing workspace.

Hey there. I'm getting this when initializing the workspace:

Error: ENOENT: no such file or directory, uv_chdir
    at Liftoff.handleArguments (C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\gulp\bin\gulp.js:108:13)
    at Liftoff.execute (C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\liftoff\index.js:203:12)
    at module.exports (C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\flagged-respawn\index.js:51:3)
    at Liftoff.<anonymous> (C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\liftoff\index.js:195:5)
    at C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\liftoff\index.js:165:9
    at C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\v8flags\index.js:110:14
    at C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\v8flags\index.js:38:12
    at C:\Users\x\.vscode\extensions\mp.oradew-vscode-0.0.4\node_modules\v8flags\index.js:49:7
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Any tips? Thanks!

Installation

Hi, great extension.
Can you put more information/examples for configuration.
Whan I press f6 I have this error:
command 'oradew.compileTask' not found

problems connecting to oracle database (proxy authentication)

hello everyone,

im working with vsc and python since a few weeks. stept by step i´m adding new packages to vsc and now i try to run oradew. it would be perfect for my daily developing.

i installed the package and initialized the workspace. now i try to config the file dbconfig.json. after doing this i run the command "Create source from db". unfortunatley that doesn´t work.

following line is in the dbconfig.json:

{"DEV":{connectString":"name in tnsnames", "users":[{"user":"user_name", "password":"user_password", "schemas": "user_schema"})}}

the command runs, no exception, but no DB-Object ist in the file-explorer, all directories src, scripts, test are empty

i tried a long time in many versions, but no success

any help is welcome :-)

Run as Script hangs for a few minutes

Hi Mickeypearce,
I noticed that when I launch a file as script (f5), it freezes for a few minutes.
The same file launched with SQLPlus (Oracle) is executed instantly.
Is there any configuration to do or is it the extension that takes time to run the script?

Thanks

Keybinding conflict with powershell

the keybinding F8 is overriding they powershell module's keybinding for F8.

The extension should configure appropriate keybinding when conditions to prevent conflicts like this.

I see that there are activation events defined for the module already but it appears these that keybindings are applied even if the extension is not activated.

Drop support for sqlplus, sqlcl Liquibase ci/cd

What do you think about dropping support for sqlplus? I say it because I plan to add sqlcl liquibase ci/cd compatibility in liquibase, and for me I don't see any advantages of mantaining two different implementations as sqlcl can do everything and more than sqlplus can do.

Select DB

Hi,
is possible to select the DB where to execute current script/procedure?

change DB shema

Hi,
is possible to have the possibility to change DB schema?
If I run the command "Run current file as Script" I can run it only in the single schema configured in dbconfig.json file?

Thanks

problems importing packages from the DB

When I import a package from the DB, VSCode doesn't handle the word EDITIONABLE.
image

es. CREATE OR REPLACE EDITIONABLE PACKAGE UTE.PIPPO

The word is correct and the toad recognizes it. If used in VScode it fails to process package symbols.
Maybe it depends on the plsql extension, but would it be possible to remove it from the package import so as not to create errors?

Another problem, when I import a package, the "/" terminator is not placed at the end.
Would it be possible to have it inserted automatically?

Thanks.

can't see compiler errors

Compile Current File works. But when I got error messages, I can't see them in the problems window. What can I do?

Performance, compile delay, persistent sqlplus / sqlcl connection

Hi @mickeypearce,

I've noticed that every time that a package or something gets compiled, a new sqlplus session is established, then compiles, and then terminates. This is quite slow as you have to wait for sqlplus initialisation every time. Would it be possible to keep a persistent connection for sqlplus waiting for new compile commands? This way the session would be always active after first compile attempt with no waiting. The idea is keeping an active session for every schema simultaneously every time that you perform a compile command, and following compile commands would execute in the same session with no waiting.

I just came across with this nice extension for vscode and I've been trying it, because I want to leave using sqldeveloper as IDE as it is very basic and a nightmare of bugs, hangs, slow etc. I have some ideas to improve it and I would love help developing it if you need help, as I think that it is near perfect for our needs.

Encoding problem in SQL-Statements

I could fix the encoding problem in packages with "package.encoding": "win1252", but in simple SQL-Statements I still got a problem.

For testing I created a script sqlplus\test_encoding-table.SQL

--DROP table test_encoding;
CREATE TABLE test_encoding
AS SELECT 'ÄÖÜ-äöüß-€' AS umlaute FROM DUAL;
SELECT * FROM test_encoding;

The ouput is

> Executing task: C:\Program Files\nodejs\node.exe c:\Users\Truetken-H\.vscode\extensions\mp.oradew-vscode-0.3.26\dist\oradew.js run --env RES_TEST --file D:\git\resus\datenbank\sqlplus\test_encoding-table.SQL --user <Auto> <

Success => RESUS@RES_TEST $D:\git\resus\datenbank\sqlplus\test_encoding-table.SQL
=============================== STDOUT ===============================
Table created.


UMLAUTE
----------
???-????-?

No errors.

When I select on this table with SQL*Plus I see

SQL> SELECT * FROM test_encoding;

UMLAUTE
----------
¿¿¿-¿¿¿¿-¿

When I run the same script using sqlplus, I got no problem.

this is my oradew.json:

{
	"source.input": ["./**/*.sql"],
	"source.encoding": "win1252",
	"source.pattern": {
		"packageSpec": "./packages/{object-name}-spec.sql",
		"packageBody": "./packages/{object-name}-body.sql",
		"trigger": "./trigger/{object-name}-trigger.sql",
		"views": "./views/{object-name}-view.sql",
		"table": "./sqlplus/{object-name}-table.sql"
	},
	"package.encoding": "win1252",
	"compile.warnings": "NONE",
	"compile.force": true,
	"compile.stageFile": false,
	"import.getDdlFunction": "dbms_metadata.get_ddl"
}

and settings.json is still the same as in #49

	"files.encoding": "windows1252",
	"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
	"terminal.integrated.shellArgs.windows": "/k chcp 1252",
	"oradew.envVariables": {
		"NLS_LANG": "GERMAN_GERMANY.WE8MSWIN1252"
	}

Ctrl-Enter doesnt seem to be working

When I do Ctrl+Enter on a SQL statement, it give an error {"error":"No params !"}

The only way i am able to run the statement is to select it and then "Run Selected Statement" - when you have a large SQL statement to run and there are multiple statements in a single file, this becomes quite a chore. Is there some kind of setting that I need to have?

Generate: "output" doesn't work

I gave the output file a name, but it is not used:
image
it should be "NETAINFAggDati.sql", instead it is called "file_CONF_VMOP_LOTTO_1606411245325.sql"

Support to use multiple DDL-commands in one file

We often have more than one DDL-commands in file, for example

CREATE OR REPLACE PACKAGE xy AS
...
END xy;
/

GRANT EXECUTE ON xy TO PUBLIC
/

This ist very useful for us, but it's a problem for ORADEW-extension.
After compiling I get the message ERROR PLS-00103: Encountered the symbol "/"

Isn't it possible to support such a command structure in ORADEW?

Oradew without GIT

Hi,
I'm using oradew but using svn instead of git.
I don't really care about versionning functionnality so i won't ask you to manage svn, but is there a way to hide the notification
"Oradew : "git" command (Git) is required in command-line"
?
I didn't found a generic way in vscode to filter it by extension.
Can you do something about it ?

Import DB object metadata

Hi,
Importing DB objects locally is a nice idea, especially if I want to work with the extension "Language PL/SQL".

The problem is that I have a large DB and it takes me a long time to import all the objects. In addition I need a lot of space on the local disk.
How can I solve the problem?
Thanks

no load module oracledb

I'm trying to create a new workspace. But I get an error. In this case, oracledb is installed, and the extensions Language PL/SQL works.

> Executing task: node /home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/gulp/bin/gulp.js --cwd /home/funtik/Projects/fsharpProject/plsql --gulpfile /home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/out/gulpfile.js --color true --silent true initProject <

/home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/oracledb/lib/oracledb.js:68
      throw new Error(nodbUtil.getErrorMessage('NJS-045', nodeInfo));
      ^

Error: NJS-045: cannot load the oracledb add-on binary for Node.js 8.14.0 (linux, x64)
Cannot load /home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/oracledb/build/Release/oracledb.node
/home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/oracledb/build/Release/oracledb.node: invalid ELF header
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

    at Object.<anonymous> (/home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/oracledb/lib/oracledb.js:68:13)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/funtik/.vscode/extensions/mp.oradew-vscode-0.1.6/node_modules/oracledb/index.js:1:80)
    at Module._compile (module.js:653:30)
Процесс терминала завершен с кодом выхода: 1

Support latest version of node

What changes are needed in order to support latest versions of node js? Is there any dependency thats needs that version?

ORADEW Doesn't Import Anything

This is pretty straight-forward, but it's only happening on one of my schemas.

I am attempting to import the existing tables, sequences, triggers, and packages from a fairly new schema that I'm working in. When I attempt to run the command "Import All Source from DB", the command runs and completes but nothing seems to be happening.

To be specific, I get all of the default folders created - scripts, src, and test, with the functions, package bodies, packages, etc... sub folders under src - but none of the actual database objects that are currently in there are having their DDL populated into the appropriate folder.

I'm not getting any sort of error messages or, well, anything when I run the command. It just completes.

Any ideas?

Separate CLI from extension

Move CLI to a separate project (submodule) that is publishable on NPM registry.
Use it as a dependency in extension...

Continuation from: #11

dbms_metadata.get_ddl does not work when used in UTL_GENERATE_ORADEW

I'm using the custom UTL_GENERATE_ORADEW package, the procedure is the one you proposed getDdl.
If I try to import the definition of tables or triggers, I get the following error, given by the procedure dbms_metadata.get_ddl:

ORA-31603: "TABLE_NAME" object of type TABLE not found in the "SCHEMA_NAME" schema
ORA-06512: a "SYS.DBMS_METADATA", line 6478
ORA-06512: a "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: a "SYS.DBMS_METADATA", line 6465
ORA-06512: a "SYS.DBMS_METADATA", line 9202
ORA-06512: a "SIU.UTL_GENERATE_ORADEW", line 726

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.