Monday, August 23, 2010

Installing firebird python power console

If you want to install the Firebird power console here are some steps on Debian/Ubuntu machines
under ipython shell

ipython -p sh


1. Install setup
tools 

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar -zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
run setup.py install

2.install the power console

wget http://ibphoenix.cz/pwc/download/PowerConsole-0.7.5.tar.gz
tar -zxvf  PowerConsole-0.7.5.tar.gz
cd PowerConsole-0.7.5
run setup.py install

3.install the firebird pack

wget http://ibphoenix.cz/pwc/download/pwcfb-0.9.1.tar.gz
tar -zxvf pwcfb-0.9.1.tar.gz

cd pwcfb-0.9.1/
run setup.py install

4. if you get that kinterbasedb is not installed just do an (This is on Debian sid and is quite recent 3.3.0)
apt-get install python-kinterbasdb

ipwc
PowerConsole v0.7.5 [CLI version]
Python 2.6.6rc2 (r266rc2:84114, Aug 18 2010, 07:33:44) 
[GCC 4.4.5 20100816 (prerelease)] on linux2

Installed packages: pwcfb(0.9.1)

Type "help" for more information.

>>> help
To get help about specific topic, PowerConsole command
or Python object/function/expression, type help .

Simple PowerConsole commands:
=============================
connect  disconnect  help  list  ready  run  set  show

Miscellaneous help topics:
==========================
firebird  python  sql  terminator

>>> help firebird
TODO: Help for topic Firebird.
    
>>> help sql
Firebird package for PowerConsole should support all valid DSQL statements and
many ISQL commands as well (see Firebird documentation for details).

However, there are some exceptions and additions:
- SET TRANSACTION does not support table reservation options (yet).
- CREATE DATABASE and CONNECT support addtional optional argument (must be last one):
AS  that makes the Database object accessible under specified name instead
default alias "db".

>>>

>>> help connect
Attach to the Firebird database.

usage: 
CONNECT 'dsn or db' [HOST host][USER 'user'][PASSWORD 'password']
  [CACHE int ][ROLE 'role'][AS var][;]

If connection is sucessfuly established, this database connection is set
as main working database. Database object is stored and accessible under
default alias "db" or as alias specified by optional AS argument. If
alias name is already used for other attached database, this database is
disconnected.



Some of the examples are here
help connect
connect 'employee' user 'sysdba' password 'masterkey'
select * from country;
xshow procedures
xshow tables
list name,owner_name in db.tables
list name in (t for t in db.triggers if 'POST_EVENT' in t.source)
list name in (i for i in db.indices if i.unique)

2 comments:

Unknown said...

Nice to see some interest in PowerConsole :) However, the examples you refer to are outdated. Better examples could be found in PowerConsole and Firebird Pack documentation.

See http://ibphoenix.cz/pwc/pwcfb/

Popa Adrian Marius said...

thanks i have updated the examples link to
http://ibphoenix.cz/pwc/pwcfb/