@@ -44,71 +44,79 @@ Also, there are a few **extension functions** available on `Connection`,
44
44
45
45
46
46
** NOTE:** This is an experimental module, and for now,
47
- we only support four databases: MS SQL, MariaDB, MySQL, PostgreSQL, and SQLite .
47
+ we only support these databases: MS SQL, MariaDB, MySQL, PostgreSQL, SQLite, and DuckDB .
48
48
49
49
Moreover, since release 0.15 we support the possibility to register custom SQL database, read more in our [ guide] ( readSqlFromCustomDatabase.md ) .
50
50
51
51
Additionally, support for JSON and date-time types is limited.
52
52
Please take this into consideration when using these functions.
53
53
54
- ## Getting started with reading from SQL database in Gradle Project
54
+ ## Getting started with reading from SQL database in a Gradle Project
55
55
56
- In the first , you need to add a dependency
56
+ First , you need to add a dependency
57
57
58
58
``` kotlin
59
59
implementation(" org.jetbrains.kotlinx:dataframe-jdbc:$dataframe_version " )
60
60
```
61
61
62
- after that, you need to add a dependency for a JDBC driver for the used database , for example
62
+ after that, you need to add the dependency for the database's JDBC driver, for example
63
63
64
64
For ** MariaDB** :
65
65
66
66
``` kotlin
67
67
implementation(" org.mariadb.jdbc:mariadb-java-client:$version " )
68
68
```
69
69
70
- Maven Central version could be found [ here] ( https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client ) .
70
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client ) .
71
71
72
72
For ** PostgreSQL** :
73
73
74
74
``` kotlin
75
75
implementation(" org.postgresql:postgresql:$version " )
76
76
```
77
77
78
- Maven Central version could be found [ here] ( https://mvnrepository.com/artifact/org.postgresql/postgresql ) .
78
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/org.postgresql/postgresql ) .
79
79
80
80
For ** MySQL** :
81
81
82
82
``` kotlin
83
83
implementation(" com.mysql:mysql-connector-j:$version " )
84
84
```
85
85
86
- Maven Central version could be found [ here] ( https://mvnrepository.com/artifact/com.mysql/mysql-connector-j ) .
86
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/com.mysql/mysql-connector-j ) .
87
87
88
88
For ** SQLite** :
89
89
90
90
``` kotlin
91
91
implementation(" org.xerial:sqlite-jdbc:$version " )
92
92
```
93
93
94
- Maven Central version could be found [ here] ( https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc ) .
94
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc ) .
95
95
96
96
For ** MS SQL** :
97
97
98
98
``` kotlin
99
99
implementation(" com.microsoft.sqlserver:mssql-jdbc:$version " )
100
100
```
101
101
102
- Maven Central version could be found [ here] ( https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc ) .
102
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc ) .
103
103
104
- In the second, be sure that you can establish a connection to the database.
104
+ For ** DuckDB ** :
105
105
106
- For this, usually, you need to have three things: a URL to a database, a username, and a password.
106
+ ``` kotlin
107
+ implementation(" org.duckdb:duckdb_jdbc:$version " )
108
+ ```
109
+
110
+ The Maven Central version can be found [ here] ( https://mvnrepository.com/artifact/org.duckdb/duckdb_jdbc ) .
111
+
112
+ Next, be sure that you can establish a connection to the database.
113
+
114
+ For this, usually, you need to have three things: a URL to the database, a username, and a password.
107
115
108
- Call one of the following functions to collect data from a database and transform it to the dataframe.
116
+ Call one of the following functions to collect data from the database and transform it to a dataframe.
109
117
110
- For example, if you have a local PostgreSQL database named as ` testDatabase ` with table ` Customer ` ,
111
- you could read first 100 rows and print the data just copying the code below:
118
+ For example, if you have a local PostgreSQL database named ` testDatabase ` with a table ` Customer ` ,
119
+ you can read the first 100 rows and print the data by just copying the code below:
112
120
113
121
``` kotlin
114
122
import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig
@@ -127,7 +135,7 @@ val df = DataFrame.readSqlTable(dbConfig, tableName, 100)
127
135
df.print ()
128
136
```
129
137
130
- Find a full example project [ here] ( https://github.com/zaleslaw/KotlinDataFrame-SQL-Examples/ ) .
138
+ You can find a full example project [ here] ( https://github.com/zaleslaw/KotlinDataFrame-SQL-Examples/ ) .
131
139
132
140
## Getting Started with Notebooks
133
141
@@ -317,7 +325,7 @@ Note that reading from the `ResultSet` could potentially change its state.
317
325
318
326
The ` dbType: DbType ` parameter specifies the type of our database (e.g., PostgreSQL, MySQL, etc.),
319
327
supported by a library.
320
- Currently, the following classes are available: ` H2, MsSql, MariaDb, MySql, PostgreSql, Sqlite ` .
328
+ Currently, the following classes are available: ` H2, MsSql, MariaDb, MySql, PostgreSql, Sqlite, DuckDb ` .
321
329
322
330
Also, users have an ability to pass objects, describing their custom databases, more information in [ guide] ( readSqlFromCustomDatabase.md ) .
323
331
@@ -525,7 +533,7 @@ This function reads the schema from a `ResultSet` object provided by the user.
525
533
526
534
The ` dbType: DbType ` parameter specifies the type of our database (e.g., PostgreSQL, MySQL, etc.),
527
535
supported by a library.
528
- Currently, the following classes are available: ` H2, MariaDb, MySql, PostgreSql, Sqlite ` .
536
+ Currently, the following classes are available: ` H2, MsSql, MariaDb, MySql, PostgreSql, Sqlite, DuckDB ` .
529
537
530
538
Also, users have an ability to pass objects, describing their custom databases, more information in [ guide] ( readSqlFromCustomDatabase.md ) .
531
539
0 commit comments