Archive for sqlite

a single file to rule them all

Adminer is a single php file  and a great database manager. It supports MySQL, PostgreSQL, SQLite, MS SQL and Oracle databases. It supports Arabic, Catalan, Chinese, Czech, Dutch, English, Estonian, French, German, Hungarian, Italian, Japanese, Portuguese, Russian, Slovak, Slovenian, Spanish, Tamil, Turkish languages. Only 318kb. with all translations included.

Features;

  • Connect to a database server with username and password
  • Select an existing database or create a new one
  • List fields, indexes, foreign keys and triggers of table
  • Change name, engine, collation, auto_increment and comment of table
  • Alter name, type, collation, comment and default values of columns
  • Add and drop tables and columns
  • Create, alter, drop and search by indexes including fulltext
  • Create, alter, drop and link lists by foreign keys
  • Create, alter, drop and select from views
  • Create, alter, drop and call stored procedures and functions
  • Create, alter and drop triggers
  • List data in tables with search, aggregate, sort and limit results
  • Insert new records, update and delete the existing ones
  • Supports all data types, blobs through file transfer
  • Execute any SQL command from a text field or a file
  • Export table structure, data, views, routines, databases to SQL or CSV
  • Print database schema connected by foreign keys
  • Show processes and kill them
  • Display users and rights and change them
  • Display variables with links to documentation
  • Manage events and table partitions (MySQL 5.1)
  • Schemas, sequences, user types (PostgreSQL)

 

Adminer database manager

 

Adminer Home Page

Leave a comment »

PySQLITE

Python 2.5 ile artık standart paketler arasında yerini aldı. Aşağıdaki örnek bir veritabanı oluşturuyor içine bir tablo açıyor ve bir kayıt ekliyor.

1 conn = sqlite3.connect('/tmp/example')2 c = conn.cursor()3 4 # Tablo oluştur5 c.execute('''create table stocks6 (date timestamp, trans varchar, symbol varchar,7 qty decimal, price decimal)''')8 9 # 1 kayıt ekle10 c.execute("""insert into stocks11 values ('2006-01-05','BUY','RHAT',100,35.14)""")12 

Python sitesinde asla pythonun string operatorleri ile sql stringi hazırlamayın diyor. Şu şekilde örnek vermiş.

1 # Bunu asla yapmayın -- Güvensiz!2 symbol = 'IBM'3 c.execute("... where symbol = '%s'" % symbol)4 5 # Bunu kullanına6 t = (symbol,)7 c.execute('select * from stocks where symbol=?', t)8 9 # Daha büyük örnek olarak:10 for t in (('2006-03-28', 'BUY', 'IBM', 1000, 45.00),11           ('2006-04-05', 'BUY', 'MSOFT', 1000, 72.00),12           ('2006-04-06', 'SELL', 'IBM', 500, 53.00),13          ):14     c.execute('insert into stocks values (?,?,?,?,?)', t)15 

Detaylı bilgi için 

Leave a comment »

Switch to our mobile site