dbext for Vim David Fishburn h5p://www.vim.org/scripts/script.php?script_id=356



Similar documents
"SQL Database Professional " module PRINTED MANUAL

How to Improve Database Connectivity With the Data Tools Platform. John Graham (Sybase Data Tooling) Brian Payton (IBM Information Management)

Release Bulletin Sybase ETL Small Business Edition 4.2

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MobiLink Synchronization with Microsoft SQL Server and Adaptive Server Anywhere in 30 Minutes

Architecture and Mode of Operation

Embarcadero DB Change Manager 6.0 and DB Change Manager XE2

Installation Guide for contineo

DevForce WinClient. DevForce Installation Guide

Data Access Guide. BusinessObjects 11. Windows and UNIX

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

SQL and programming languages

8- Management of large data volumes

Toad for Oracle 8.6 SQL Tuning

DBI-Link: 3.0. PgCon Ottawa 2008 Copyright David Fetter 2008 All Rights Reserved

Databases and SQL. The Bioinformatics Lab SS Wiki topic 10. Tikira Temu. 04. June 2013

Microsoft SQL Server Features that can be used with the IBM i

VBA and Databases (see Chapter 14 )

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Migration to SQL Server With Ispirer SQLWays 6.0

MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy

KonyOne Server Installer - Linux Release Notes

Mercury Users Guide Version 1.3 February 14, 2006

DEVELOPMENT OF AN ANALYSIS AND REPORTING TOOL FOR ORACLE FORMS SOURCE CODES

SIMIAN systems. Setting up a Sitellite development environment on Windows. Sitellite Content Management System

DBX. SQL database extension for Splunk. Siegfried Puchbauer

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

Increasing Driver Performance

SQL Server Instance-Level Benchmarks with DVDStore

Advanced SQL Injection in Oracle databases. Esteban Martínez Fayó

Setting up a database for multi-user access

PAYMENTVAULT TM LONG TERM DATA STORAGE

INTRODUCTION DATABASE MANAGEMENT SYSTEMS

Migrating Non-Oracle Databases and their Applications to Oracle Database 12c O R A C L E W H I T E P A P E R D E C E M B E R

Database Master User Manual

Using the Eclipse Data Tools Platform with SQL Anywhere 10. A whitepaper from Sybase ianywhere

DiskPulse DISK CHANGE MONITOR

Connecting to your Database!... 3

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

Review of SwisSQL Data Migration Tool

MyOra 4.5. User Guide. SQL Tool for Oracle. Kris Murthy

PUBLIC Installation: SAP Mobile Platform Server for Linux

SQL Anywhere 12 New Features Summary

CS346: Database Programming.

Setting up SQL Translation Framework OBE for Database 12cR1

PROCESSES LOADER 9.0 SETTING. Requirements and Assumptions: I. Requirements for the batch process:

Configuring the BIG-IP LTM v11 for Oracle Database and RAC

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

Getting Started using the SQuirreL SQL Client

Database Management System Choices. Introduction To Database Systems CSE 373 Spring 2013

CSC 370 Database Systems Summer 2004 Assignment No. 2

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

Synametrics Technologies. WinSQL Professional User s Guide Version 8.5

Copyright Software Technology, Inc Cushman Drive Lincoln, NE (402)

The Advantages of PostgreSQL

Q&A for Zend Framework Database Access

PaperClip32. Installation Guide. for Workgroup and Enterprise Editions. Document Revision 2.1 1

Programming Database lectures for mathema

HTSQL is a comprehensive navigational query language for relational databases.

Documentum Business Process Analyzer and Business Activity Monitor Installation Guide for JBoss

Setting Up a CLucene and PostgreSQL Federation

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

Crystal Reports Setup

Embedded SQL. Unit 5.1. Dr Gordon Russell, Napier University

ODBC Client Driver Help Kepware, Inc.

PaperClip Audit System Installation Guide

and what does it have to do with accounting software? connecting people and business

Database Applications with VDBT Components

Financial Data Access with SQL, Excel & VBA

ReportBy ODBC Connection setup

Module 15: Monitoring

CA ARCserve Backup for Windows

Sisense. Product Highlights.

9.1 SAS. SQL Query Window. User s Guide

BI Studio User Manual

Developing Physical Solutions for InfoSphere Master Data Management Server Advanced Edition v11. MDM Workbench Development Tutorial

SQL Anywhere New Features Summary

CA ARCserve Backup for Windows

Configuring and Monitoring Database Servers

Specifications of Paradox for Windows

Video Administration Backup and Restore Procedures

SAP BW on HANA & HANA Smart Data Access Setup

Cloud Services. Introduction...2 Overview...2. Security considerations Installation...3 Server Configuration...4

Accessing a Microsoft SQL Server Database from SAS on Microsoft Windows

OBJECTSTUDIO. Database User's Guide P

StoreGrid Backup Server With MySQL As Backend Database:

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language:

IBM DB2 Lab - ITFac. Lab 02: Getting started with DB2. Information Management Cloud Computing Center of Competence IBM Canada Lab

SAP Business Objects Business Intelligence platform Document Version: 4.1 Support Package Data Federation Administration Tool Guide

What s New in Delphi for PHP 2.0. New and Enhanced IDE Features. Form Designer

Working with the Cognos BI Server Using the Greenplum Database

Oracle Database Creation for Perceptive Process Design & Enterprise

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Transcription:

dbext for Vim David Fishburn h5p://www.vim.org/scripts/script.php?script_id=356

dbext Database extension Database agnositc Allows you to execute SQL and query databases without having to leave your editor Speed up development by having tools at your finger Kps via commands, maps and menu items

Features Execute any SQL statement and show the results (if any) Describe Tables, Procedures Useful for variable definikon Generate Table, Procedure, View and Column lists Object lists for quick lookups Column lists for SELECT statements

OMNI CompleKon Integrates with Vim s built in OMNI complekon (or Intellisense) Completes based on SQL syntax Vim by default has 13 different SQL syntax files If dbext is available completes dynamically from your database Tables, procedures, views, columns Assists wrikng new SQL statements

Database Types Sybase SQL Anywhere (ASA) Sybase SQL Anywhere UltraLite (ULTRALITE) Sybase AdapKve Server Enterprise (ASE) Oracle (ORA) Oracle Rdb (RDB) Microso` Sql Server (SQLSRV) IBM DB2 (DB2) MySQL (MYSQL) PostgreSQL (PGSQL) SQLite (SQLITE) Firebird (FIREBIRD) Ingres (INGRES) Interbase (INTERBASE) The following are only available with the Perl DBI extension plug. It requires a Perl enabled Vim (i.e. echo has('perl') ) Perl DBI (DBI) Perl DBI::ODBC (ODBC)

NaKve Types All the non Perl types access the database by shelling out and running the standard binaries isql, psql, mysql, dbisql, sqlplus, osql Means the database client so`ware must be installed on your machine Results are displayed in a Vim buffer

Perl DBI and ODBC Perl offers many advantages over the nakve types Loaded in memory and maintains a conneckon Faster between uses and can commit and rollback The output is forma5ed a be5er Only the Perl module must be installed not the nakve client which may not be available on all plaeorms I use this almost exclusively

Profiles Each buffer can be connected to a different database ConnecKon informakon can be saved in your.vimrc Modelines can be set in each file Autocmds can be used to set profiles based on directory informakon Default profiles can be specified

Profile Examples let g:dbext_default_profile_asa_smm = 'type=odbc:user=:passwd=:dsnname=smm' let g:dbext_default_profile_asa = 'type=asa:user=dba:passwd=sql' let g:dbext_default_profile_mysql_local = 'type=mysql:user=root:passwd=:dbname=my sql:extra= t'

Modeline A comment at the beginning or end of your file allows you to customize various segngs // dbext:profile=asa_smm

Autocmds augroup smm au! autocmd bufread */\(HostedProdEnv\ SMM\)/* DBSetOpKon profile='asa_smm' autocmd bufread */\(HostedProdEnv\ SMM\)/* let g:dbext_default_variable_def_regex = DB_listOpKon('variable_def_regex') \ let b:dbext_variable_def_regex = g:dbext_default_variable_def_regex. ',\<\(p_\ lv_\)\w \+\>' augroup end

Default Profile If you usually connect to the same database you can setup a default profile if the first Kme you use dbext conneckon informakon was not already specified let g:dbext_default_profile = 'ASA_SMM'

General Commands Execute arbitrary SQL Select from table (under cursor) List tables List columns (for paskng) Describe Objects Reuse variables

FileType Support Each filetype, SQL, Perl, C, Java,... has standard string formats Variables can be embedded within the strings ConcatenaKon can be used to build a SQL statement Select 1, 2 + from mytable Prepared statements can also be used Select 1, 2 from mytable where col1 = $myvar

FileType Rules Based on the filetype dbext can determine how to parse a string, remove any concatenakon and find variables Prompt the user for the variables Execute the statement Display the results

Perl FileType Prompt for $mycol1 and $cols[1] my $sql = "SELECT c1, c2 FROM table1 WHERE c1 = $mycol1 AND c2 = ". $cols[1];

Java FileType Prompt for both?s and user String query = "SELECT c1, c2 " + " FROM table1 " + " WHERE c3 =? " + " AND c4 =? " + " AND c5 = " + user + " AND c6 > 4 ";

Help I need some help implemenkng: DisconnectAll Reconnect a`er Kmeout interval Unfortunately, it takes me a long Kme to write Perl, but you guys should whip this off like breathing!