close

SQLite - 檔案型資料庫

Microsoft Access 是 Windows 平台下蠻常被使用的檔案型資料庫。之所以說是檔案型,那是因為在 Microsoft Access 裡,每個資料庫就是一個檔案,所以對中小型的應用來說,此種資料庫是最常被拿來應用的。檔案型的資料庫有個好處是備份方便,以及降低系統的負載(比起一般 server-client 架構的資料庫系統)。但是使用 Microsoft Access 其實會有很多潛在的問題...

有甚麼問題?對我來說最大的問題是綁平台以及需要花錢。我希望自己花精力以及時間去學的東西,可以有較長的生命週期(雖然不能奢望學的東西可以用到退休,但至少越長越好吧?),所以我當然希望我學的東西可以不用受到特定廠商的控制。要是明天微軟宣佈不再支援 Microsoft Access ,甚至是在未來的系統移除了對 Microsoft Access 的支援,我該怎麼辦?看看 Visual Basic ...

除了上述的原因,我也看過相關的文章有提到 Microsoft Access 其實只適合小型的運用(沒錯,其實我只用過 Microsoft Access 幾次,可以說根本不熟)...一旦規模大起來了它的效能會遇到瓶頸。而本文的主角(終於來了) SQLite 在效能上倒是非常出色。

SQLite 優點其實很多呢,在這邊挑幾個出來講囉:

1. 體積小(這裡指的是安裝所需的空間,當然實際的資料庫大小就看你資料的多寡囉)、備份方便。我忘記實際的大小了,但我記得如果只是要在系統上裝上 SQLite 的支援( libsqlite ),只要幾百KB的大小。加上它是檔案型資料庫,備份其實就是把整個檔案備份起來就好了。


2. 優異的效能。在這邊有 SQLite 的測試數據。在「需要經常讀取,但是寫入次數不高」的情況下,效能甚至超越了以速度聞名的 MySQL 。


3. 眾多語言支援。常見的語言都已經支援了 SQLite ,清單在這。


4. 跨平台。目前主流的作業系統都支援, Mac 甚至在最新的作業系統 Mac OS X
Leopard 中讓 SQLite 成為預設的資料庫。


接下來介紹SQLite Database Browser

Building Instructions and Requirements

建立指示和需求

 

SQLite Database Browser requires Trolltech's QT. It has been tested with versions 3.12, 3.2 and 3.3 of QT. QT can be included as a static or shared library, depending on the current QT configuration in the building machine. For more information on QT please consult http://www.trolltech.com. The GPL version of QT is available in almost all Linux distributions as a default package.

SQLite 資料庫瀏覽器需要TrolltechQT  它已經被QT中的3.12,3.2 3.3版本測試。  依據當前QT的建立配置可以包括靜態或動態library。更多的QT資訊請查閱http://www.trolltech.com  QTGPL 版本幾乎所有linux發布的預設package都是有效的。

 

SQLite is not used as a shared library: it is built from source code included in this package (sqlite_source directory), and linked as a static library into the executable.

SQLite沒被作為動態library使用︰ 它建立源於原始碼包含package (sqlite_source directory),而且作為靜態library連結到可執行檔。

 

SQLite is ideal for embedding, so the only requirement for building this code is the presence of QT. QT can be included as a static or shared library, depending on the current QT configuration in the building machine.

SQLite 對於嵌入式是理想完美的,編譯SQLite的唯一要求是要有QT  當一座靜止或者合用的圖書館,在大樓機器取決於當今的QT 構造時,QT可以被包括。依據當前QT的建立配置可以包括靜態或動態library

 

Provided you have QT installed and configured, simply run

假若你要安裝並且配置QT,只須執行

 

qmake

 

followed by

隨後

 

make

 

in the main directory. This will generate thesqlitebrowser (or sqlitebrowser.exe, or sqlitebrowser.app)application in the sqlitebrowser subdirectory.

在主要目錄裡。將產生sqlitebrowser(或者sqlitebrowser.exe或者sqlitebrowser.app) 應用程式在sqlitebrowser次目錄裡的。

 

The same process works for building the code in any platform supported by QT (including other Unix systems with X11.)

同樣的編譯過程可以在任何有支援QT的平台(including other Unix systems with X11.)

 

 下面是授權說明,我就不做翻譯了。


Licensing

 

This code is in Public Domain. You may do whatever you want with it.

 

However, the same is not true for the QT libraries needed to build this software, and this places restrictions on how you can develop and license derivative works.

 

The original code was developed and built with licensed, commercial versions of QT on Windows, MacOSX and Linux. Developers that wish to produce derivative work and use it in commercial projects need to hold a commercial QT license as well.

 

If you are however working on a project licensed with the GPL you may use the GPL version of QT. You may release derivative works of this software with any license you want as long as we are concerned, including GPL, Public Domain or Commercial, provided you abide to the licensing terms of the version of QT you have installed on your machine.

 

There are GPL versions of QT available at www.trolltech.com for X11 and MacOSX, and QT/GPL is included in almost all Linux distributions since it is required by KDE. Windows users however need to purchase a commercial version of QT (there is no GPL version for QT 3.x for Windows at this time.) Please consult ww.trolltech.com/licensing if you have any questions about QT licensing.

 

 

 

Redistribution of Binaries

 

The binaries available at sqlitebrowser.sourceforge.net were built with fully licensed commercial versions of QT, and can be redistributed freely. The Windows and MacOSX versions are standalone applications (QT has been statically linked), while the Linux packages used a shared QT 3 (qt-mt) library already present in almost all modern Linux distributions since it is a requirement for KDE and several popular packages.

arrow
arrow
    全站熱搜

    flykof 發表在 痞客邦 留言(0) 人氣()