Difference between revisions of "Lazarus Database Overview/pl"

From Free Pascal wiki
Jump to navigationJump to search
(→‎Lazarus and Oracle: tłumaczenie na j. polski)
(→‎Lazarus and PostgreSQL: tłumaczenie na j. polski)
Line 55: Line 55:
 
# [https://www.devart(dot)com/odac/ Komponenty dostępu do Oracle dla Lazarusa] / zamień (dot) na kropkę w tym adresie /
 
# [https://www.devart(dot)com/odac/ Komponenty dostępu do Oracle dla Lazarusa] / zamień (dot) na kropkę w tym adresie /
  
== Lazarus and PostgreSQL ==
+
== Lazarus i PostgreSQL ==
* PostgreSQL is very well supported out of the box by FPC/Lazarus
+
* PostgreSQL jest bardzo dobrze obsługiwany przez FPC/Lazarus
* Please see [[postgres]] for details on various access methods, which include:
+
* Zobacz [[postgres]], aby uzyskać szczegółowe informacje na temat różnych metod dostępu, które obejmują:
# Built-in SQLdb support. Use component '''TPQConnection''' from the [[SQLdb tab]] of the [[Component Palette]]  
+
# Wbudowana obsługa bazy danych SQLdb. Użyj komponentu '''TPQConnection''' z [[SQLdb tab|karty SQLdb]] [[Component Palette|Palety komponentów]]
# [[Zeos]]. Use component '''TZConnection''' with protocol 'postgresql' from palette '''Zeos Access'''
+
# [[Zeos]]. Użyj komponentu '''TZConnection''' z protokołem 'postgresql' z palety '''Zeos Access'''
# [https://www.devart(dot)com/pgdac/ PostgreSQL data access Lazarus component]
+
# [https://www.devart(dot)com/pgdac/ Komponenty dostępu do PostgreSQL dla Lazarusa] / zamień (dot) na kropkę w tym adresie /
  
 
== Lazarus and SQLite ==
 
== Lazarus and SQLite ==

Revision as of 11:44, 23 November 2021

English (en) español (es) français (fr) 日本語 (ja) polski (pl) русский (ru)

Przegląd baz danych w Lazarusie
Portal bazy danych

Bibliografia:

Poradniki/porady praktyczne:

Bazy danych

Advantage - MySQL - MS SQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos

Przegląd

Ten artykuł jest przeglądem, które bazy danych mogą współpracować z Lazarusem.

Lazarus od ręki obsługuje kilka baz danych (przy użyciu np. frameworka SQLDB), jednak deweloper musi zainstalować wymagane pakiety (biblioteki klienckie) dla każdej z nich.

Dostęp do bazy danych można uzyskać za pomocą kodu lub upuszczając komponenty na formularz. Komponenty obsługujące dane reprezentują pola i są połączone przez ustawienie właściwości DataSource tak, aby wskazywała na TDataSource. DataSource reprezentuje tabelę i jest połączony z komponentami bazy danych (np.: TPSQLDatabase, TSQLiteDataSet) przez ustawienie właściwości DataSet. Komponenty obsługujące dane znajdują się na karcie Data Controls. Kontrolki DataSource i bazy danych znajdują się na karcie „Data Access”.

Zobacz poradniki dotyczące wbudowanego dostępu do bazy danych Lazarus/FPC, odpowiednie dla Firebird, MySQL, SQLite, PostgreSQL itp.:

Lazarus i Interbase / Firebird

  • Firebird jest bardzo dobrze obsługiwany przez FPC/Lazarus (przy użyciu SQLDB); zobacz Firebird aby poznać szczegóły.
  • Inne biblioteki Firebird zawierają listy alternatywnych bibliotek dostępu (np. PDO, Zeos, FBlib).

Lazarus i MySQL

  • Zobacz mysql, aby uzyskać szczegółowe informacje na temat różnych metod dostępu, które obejmują:
  1. Wbudowana obsługa SQLdb
  2. PDO
  3. Zeos
  4. Komponenty dostępu do MySQL dla Lazarusa / zamień (dot) na kropkę w tym adresie /

Lazarus i MSSQL/Sybase

Możesz połączyć się z bazami danych Microsoft SQL Server za pomocą

  1. Komponenty dostępu do SQL Server dla Lazarusa / zamień (dot) na kropkę w tym adresie /. Działają na Windows i macOS. Do ściągnięcia za darmo.
  2. Wbudowane konektory SQLdb: TMSSQLConnection i TSybaseConnection (od Lazarusa 1.0.8/FPC 2.6.2): ​​patrz mssqlconn.
  3. Komponent Zeos TZConnection (najnowszy CVS, zobacz linki do Zeosa w innym miejscu na tej stronie)
    1. W systemie Windows można wybrać między biblioteką natywną ntwdblib.dll (protokół mssql) lub bibliotekami FreeTDS (protokół FreeTDS_MsSQL-nnnn), gdzie nnnn jest jednym z czterech wariantów w zależności w wersji serwerowej. Dla Delphi (nie Lazarusa) istnieje również inny protokół Zeos ado dla MSSQL 2005 lub nowszego. Korzystanie z protokołów mssql lub ado generuje kod, który nie jest niezależny od platformy.
    2. W systemie Linux jedynym sposobem są protokoły i biblioteki FreeTDS (powinieneś użyć libsybdb.so).
  4. ODBC (MSSQL i Sybase ASE) z SQLdb TODBCConnection (zamiast tego rozważ użycie TMSSQLConnection i TSybaseConnection)
    1. Zobacz także [1]
    2. W systemie Windows wykorzystywane są natywne biblioteki Microsoft ODBC (np. sqlsrv32.dll dla MSSQL 2000)
    3. W systemie Linux używane są unixODBC + FreeTDS (pakiety unixodbc lub iodbc oraz tdsodbc). Od 2012 roku istnieje również Microsoft SQL Server ODBC Driver 1.0 dla systemu Linux, który jest produktem binarnym (bez otwartego źródła) i zapewnia natywną łączność, ale został wydany tylko w architekturze 64-bitowej i tylko dla RedHat.

Lazarus i ODBC

ODBC to ogólny standard połączenia z bazą danych, który jest dostępny w systemach Linux, Windows i macOS. Będziesz potrzebować sterownika ODBC od dostawcy bazy danych i skonfigurować „źródło danych” ODBC (znane również jako DSN). Komponentów SQLDB (TODBCConnection) można używać do łączenia się ze źródłem danych ODBC. Zobacz ODBCConn, aby uzyskać więcej szczegółów i przykładów.

Microsoft Access

Możesz użyć sterownika ODBC w systemie Windows i Linux, aby uzyskać dostęp do baz danych Access; zobacz MS Access

Lazarus i Oracle

  • Zobacz Oracle. Metody dostępu obejmują:
  1. Wbudowana obsługa bazy danych SQL
  2. Zeos
  3. Komponenty dostępu do Oracle dla Lazarusa / zamień (dot) na kropkę w tym adresie /

Lazarus i PostgreSQL

  • PostgreSQL jest bardzo dobrze obsługiwany przez FPC/Lazarus
  • Zobacz postgres, aby uzyskać szczegółowe informacje na temat różnych metod dostępu, które obejmują:
  1. Wbudowana obsługa bazy danych SQLdb. Użyj komponentu TPQConnection z karty SQLdb Palety komponentów
  2. Zeos. Użyj komponentu TZConnection z protokołem 'postgresql' z palety Zeos Access
  3. Komponenty dostępu do PostgreSQL dla Lazarusa / zamień (dot) na kropkę w tym adresie /

Lazarus and SQLite

SQLite is an embedded database; the database code can be distributed as a library (.dll/.so/.dylib) with your application to make it self-contained (comparable to Firebird embedded). SQLite is quite popular due to its relative simplicity, speed, small size and cross-platform support.

Please see the SQLite page for details on various access methods, which include:

  1. Built-in SQLDb support. Use component TSQLite3Connection from palette SQLdb
  2. Zeos
  3. SQLitePass
  4. TSQLite3Dataset
  5. SQLite data access Lazarus components

Lazarus and Firebird/Interbase

InterBase (and FireBird) Data Access Components (IBDAC) is a library of components that provides native connectivity to InterBase, Firebird and Yaffil from Lazarus (and Free Pascal) on Windows, macOS, iOS, Android, Linux, and FreeBSD for both 32-bit and 64-bit platforms. IBDAC-based applications connect to the server directly using the InterBase client. IBDAC is designed to help programmers develop faster and cleaner InterBase database applications.

IBDAC is a complete replacement for standard InterBase connectivity solutions. It presents an efficient alternative to InterBase Express Components, the Borland Database Engine (BDE), and the standard dbExpress driver for access to InterBase.

Firebird data access components for Lazarus are free to download.

Lazarus and dBase

FPC includes a simple database component that is derived from the Delphi TTable component called "TDbf" TDbf Website). It supports various DBase and Foxpro formats.

TDbf does not accept SQL commands but you can use the dataset methods etc and you can also use regular databound controls such as the DBGrid.

It doesn't require any sort of runtime database engine. However it's not the best option for large database applications.

See the TDbf Tutorial page for the tutorial as well as documentation.

You can use e.g. OpenOffice/LibreOffice Base to visually create/edit dbf files, or create DBFs in code using TDbf.

Lazarus and Paradox

Paradox was the default format for database files in old versions of Delphi. The concept is similar to DBase files/DBFs, where the "database" is a folder, and each table is a file inside that folder. Also, each index is a file too. To access this files from Lazarus we have these options:

  • TParadox: Install package "lazparadox 0.0" included in the standard distribution. When you install this package, you will see a new component labeled "PDX" in the "Data Access" palette. This component is not standalone, it uses a "native" library, namely the pdxlib library which is available for Linux and Windows. For example, to install in Debian, you could get pxlib1 from package manager. In Windows you need the pxlib.dll file.
  • TPdx: Paradox DataSet for Lazarus and Delphi from this site. This component is standalone (pure object pascal), not requiring any external library, but it can only read (not write) Paradox files. The package to install is "paradoxlaz.lpk" and the component should appear in the "Data Access" palette with PDX label (but orange colour).
  • TParadoxDataSet: is a TDataSet that can only read Paradox Files up to Version 7. The approach is similar to the TPdx component, the package to install is "lazparadox.lpk" and the component should also appear in the "Data Access" palette.

TSdfDataset and TFixedDataset

TSdfDataSet and TFixedFormatDataSet are two simple TDataSet descandants which offer a very simple textual storage format. These datasets are very convenient for small databases, because they are fully implemented as an Object Pascal unit, and thus require no external libraries. Also, their textual format allows them to be easily viewed/edited with a text editor.

See CSV for example code.

Lazarus and Advantage Database Server

See also

(Sorted alphabetically)

External links

  • Pascal Data Objects - a database API that worked for both FPC and Delphi and utilises native MySQL libraries for version 4.1 and 5.0 and Firebird SQL 1.5, and 2.0. It's inspired by PHP's PDO class.
  • Zeos+SQLite Tutorial - Good tutorial using screenshots and screencasts it explain how to use SQLite and Zeos, spanish (google translate does a good work in translating it to english)