SaSqlConsole : install & run : export to csv

hdknr@LennyOne:~/bitbucket$ hg clone https://hdknr@bitbucket.org/bobf/sasqlconsole/
destination directory: sasqlconsole
requesting all changes
adding changesets
adding manifests
adding file changes
added 60 changesets with 85 changes to 19 files
updating working directory
9 files updated, 0 files merged, 0 files removed, 0 files unresolved

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sudo python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/sasqlconsole
copying sasqlconsole/console.py -> build/lib/sasqlconsole
copying sasqlconsole/__init__.py -> build/lib/sasqlconsole
copying sasqlconsole/data.py -> build/lib/sasqlconsole
copying sasqlconsole/config.py -> build/lib/sasqlconsole
running build_scripts
creating build/scripts-2.5
copying and adjusting sasql -> build/scripts-2.5
changing mode of build/scripts-2.5/sasql from 644 to 755
running install_lib
creating /usr/lib/python2.5/site-packages/sasqlconsole
copying build/lib/sasqlconsole/console.py -> /usr/lib/python2.5/site-packages/sasqlconsole
copying build/lib/sasqlconsole/__init__.py -> /usr/lib/python2.5/site-packages/sasqlconsole
copying build/lib/sasqlconsole/data.py -> /usr/lib/python2.5/site-packages/sasqlconsole
copying build/lib/sasqlconsole/config.py -> /usr/lib/python2.5/site-packages/sasqlconsole
byte-compiling /usr/lib/python2.5/site-packages/sasqlconsole/console.py to console.pyc
byte-compiling /usr/lib/python2.5/site-packages/sasqlconsole/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.5/site-packages/sasqlconsole/data.py to data.pyc
byte-compiling /usr/lib/python2.5/site-packages/sasqlconsole/config.py to config.pyc
running install_scripts
copying build/scripts-2.5/sasql -> /usr/bin
changing mode of /usr/bin/sasql to 755
running install_egg_info
Writing /usr/lib/python2.5/site-packages/SASqlConsole-0.1.0.egg-info

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sasql
Unable to import sqlparse:
http://python-sqlparse.googlecode.com

Traceback (most recent call last):
  File "/usr/bin/sasql", line 3, in <module>
    from sasqlconsole.console import main
  File "/usr/lib/python2.5/site-packages/sasqlconsole/console.py", line 27, in <module>
    import sqlparse

hdknr@LennyOne:~/bitbucket/sasqlconsole$ dpkg -l | grep alchemy
ii  python-sqlalchemy                 0.4.7p1-2                  SQL toolkit and Object Relational Mapper for Python

hdknr@LennyOne:~/bitbucket/sasqlconsole$ yolk -S name=sqlparse
sqlparse (0.1.1):
        Non-validating SQL parser

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sudo easy_install sqlparse
Searching for sqlparse
Reading http://pypi.python.org/simple/sqlparse/
Reading http://python-sqlparse.googlecode.com/
Best match: sqlparse 0.1.1
Downloading http://python-sqlparse.googlecode.com/files/sqlparse-0.1.1.tar.gz
Processing sqlparse-0.1.1.tar.gz
Running sqlparse-0.1.1/setup.py -q bdist_egg –dist-dir /tmp/easy_install-TADm8N/sqlparse-0.1.1/egg-dist-tmp-uKyyQf
zip_safe flag not set; analyzing archive contents…
Adding sqlparse 0.1.1 to easy-install.pth file
Installing sqlformat script to /usr/bin

Installed /usr/lib/python2.5/site-packages/sqlparse-0.1.1-py2.5.egg
Processing dependencies for sqlparse
Finished processing dependencies for sqlparse

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sasql
Connecting to "sqlite://"…done.
sql>

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sasql mysql://root:hdknr@localhost/postfix
Connecting to "mysql://root:hdknr@localhost/postfix"…done.
sql>

sql> select * from admin;
Rowcount: 1 | Time: 15.5ms
username        password                           created             modified            active
hdknr@hdknr.deb $1$62e25a6e$cB5kzY0xLkDAlT/M1FItS/ 2009-07-22 17:01:02 2009-07-22 17:01:02 1

sql> .csv hoge.csv select * from admin;
Rowcount: 1
1 rows (including header) written to "hoge.csv"

hdknr@LennyOne:~/bitbucket/sasqlconsole$ more hoge.csv
username,password,created,modified,active
hdknr@hdknr.deb,$1$62e25a6e$cB5kzY0xLkDAlT/M1FItS/,2009-07-22 17:01:02,2009-07-22 17:01:02,1

hdknr@LennyOne:~/bitbucket/sasqlconsole$ sasql mysql://root:hdknr@localhost/postfix -i
Connecting to "mysql://root:hdknr@localhost/postfix"…done.
sql> .csv hoge2.csv select password,active ,username,modified,created from admin;
Rowcount: 1
1 rows (including header) written to "hoge2.csv"

hdknr@LennyOne:~/bitbucket/sasqlconsole$ more hoge2.csv
password,active,username,modified,created
$1$62e25a6e$cB5kzY0xLkDAlT/M1FItS/,1,hdknr@hdknr.deb,2009-07-22 17:01:02,2009-07-22 17:01:02

Fine!!!!!!

カテゴリー: 未分類 パーマリンク

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中