|
1 | | -# ScalarDB SQL |
2 | | - |
3 | | -ScalarDB SQL is an SQL layer for ScalarDB. |
4 | | -Specifically, it parses SQL and converts it to a set of ScalarDB (API) operations. |
5 | | - |
6 | | -## Install |
7 | | - |
8 | | -The libraries for ScalarDB SQL are available on the [Maven Central Repository](https://mvnrepository.com/artifact/com.scalar-labs/scalardb-sql) and as [packages on GitHub](https://github.com/orgs/scalar-labs/packages?repo_name=scalardb-sql). Since they are available under a commercial license, you need to get a license and permission to access them. For more details, please [contact us](https://scalar-labs.com/contact_us/). |
9 | | - |
10 | | -Before you add the dependency, you need to add the Maven repository using your build tool such as Gradle and Maven. |
11 | | - |
12 | | -To add the Maven repository using Gradle, add the following repository to your `build.gradle`: |
13 | | -```gradle |
14 | | -repositories { |
15 | | - maven { |
16 | | - url = uri("https://maven.pkg.github.com/scalar-labs/scalardb-sql") |
17 | | - credentials { |
18 | | - username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") |
19 | | - password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") |
20 | | - } |
21 | | - } |
22 | | -} |
23 | | -``` |
24 | | - |
25 | | -In this case, you need the `gpr.user` property for your GitHub username and the `gpr.key` property for your personal access token. |
26 | | -So you need to have the properties in `~/.gradle/gradle.properties`, or specify the properties with the `-P` option when running the `./gradlew` command as follows: |
27 | | - |
28 | | -```console |
29 | | -./gradlew build -Pgpr.user=<your GitHub username> -Pgpr.key=<your personal access token> |
30 | | -``` |
31 | | - |
32 | | -Or you can also use environment variables, `USERNAME` for your GitHub username and `TOKEN` for your personal access token. |
33 | | - |
34 | | -```console |
35 | | -export USERNAME=<your GitHub username> |
36 | | -export TOKEN=<your personal access token> |
37 | | -``` |
38 | | - |
39 | | -To add the Maven repository using Maven, edit your `~/.m2/settings.xml` file as follows: |
40 | | -```xml |
41 | | -<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" |
42 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
43 | | - xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 |
44 | | - http://maven.apache.org/xsd/settings-1.0.0.xsd"> |
45 | | - |
46 | | - <activeProfiles> |
47 | | - <activeProfile>github</activeProfile> |
48 | | - </activeProfiles> |
49 | | - |
50 | | - <profiles> |
51 | | - <profile> |
52 | | - <id>github</id> |
53 | | - <repositories> |
54 | | - <repository> |
55 | | - <id>central</id> |
56 | | - <url>https://repo1.maven.org/maven2</url> |
57 | | - </repository> |
58 | | - <repository> |
59 | | - <id>github</id> |
60 | | - <url>https://maven.pkg.github.com/scalar-labs/scalardb-sql</url> |
61 | | - <snapshots> |
62 | | - <enabled>true</enabled> |
63 | | - </snapshots> |
64 | | - </repository> |
65 | | - </repositories> |
66 | | - </profile> |
67 | | - </profiles> |
68 | | - |
69 | | - <servers> |
70 | | - <server> |
71 | | - <id>github</id> |
72 | | - <username>USERNAME</username> |
73 | | - <password>TOKEN</password> |
74 | | - </server> |
75 | | - </servers> |
76 | | -</settings> |
77 | | -``` |
78 | | - |
79 | | -In the `servers` tag, add a child `server` tag with an `id`, replacing *USERNAME* with your GitHub username, and *TOKEN* with your personal access token. |
80 | | - |
81 | | -Please see also the following documents for more details: |
82 | | -- [Working with the Gradle registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry) |
83 | | -- [Working with the Apache Maven registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry) |
84 | | - |
85 | | -And then, you can install the library in your application using your build tool such as Gradle and Maven. |
86 | | - |
87 | | -To add a dependency on ScalarDB SQL using Gradle, use the following: |
88 | | -```gradle |
89 | | -dependencies { |
90 | | - // For Direct mode |
91 | | - implementation 'com.scalar-labs:scalardb-sql-direct-mode:3.13.2' |
92 | | -
|
93 | | - // For Server mode |
94 | | - implementation 'com.scalar-labs:scalardb-sql-server-mode:3.13.2' |
95 | | -} |
96 | | -``` |
97 | | - |
98 | | -To add a dependency using Maven: |
99 | | -```xml |
100 | | -<dependencies> |
101 | | - <!-- For Direct mode --> |
102 | | - <dependency> |
103 | | - <groupId>com.scalar-labs</groupId> |
104 | | - <artifactId>scalardb-sql-direct-mode</artifactId> |
105 | | - <version>3.13.2</version> |
106 | | - </dependency> |
107 | | - |
108 | | - <!-- For Server mode --> |
109 | | - <dependency> |
110 | | - <groupId>com.scalar-labs</groupId> |
111 | | - <artifactId>scalardb-sql-server-mode</artifactId> |
112 | | - <version>3.13.2</version> |
113 | | - </dependency> |
114 | | -</dependencies> |
115 | | -``` |
116 | | - |
117 | | -## Docs |
118 | | - |
119 | | -- [Getting Started with ScalarDB SQL](getting-started-with-sql.mdx) |
120 | | -- [Getting Started with ScalarDB JDBC](getting-started-with-jdbc.mdx) |
121 | | -- [ScalarDB SQL API Guide](sql-api-guide.mdx) |
122 | | -- [ScalarDB JDBC Guide](jdbc-guide.mdx) |
123 | | -- [ScalarDB SQL Grammar](grammar.mdx) |
124 | | -- [ScalarDB SQL Command Line interface](../scalardb-cluster/developer-guide-for-scalardb-cluster-with-java-api.mdx#sql-cli) |
125 | | -- [ScalarDB SQL Server](sql-server.mdx) |
126 | | -- [ScalarDB SQL Configurations](configurations.mdx) |
127 | | -- [Guide of Spring Data JDBC for ScalarDB](spring-data-guide.mdx) |
128 | | -- Javadoc |
129 | | - - [scalardb-sql](https://scalar-labs.github.io/scalardb-sql/javadoc/core/index.html) - ScalarDB SQL: A SQL layer for ScalarDB |
130 | | - - [scalardb-direct-mode](https://scalar-labs.github.io/scalardb-sql/javadoc/direct-mode/index.html) - ScalarDB SQL Direct mode |
131 | | - - [scalardb-sql-rpc](https://scalar-labs.github.io/scalardb-sql/javadoc/rpc/index.html) - ScalarDB SQL RPC libraries |
132 | | - - [scalardb-sql-server](https://scalar-labs.github.io/scalardb-sql/javadoc/server/index.html) - ScalarDB SQL Server: A gRPC interface of ScalarDB SQL |
133 | | - - [scalardb-server-mode](https://scalar-labs.github.io/scalardb-sql/javadoc/server-mode/index.html) - ScalarDB SQL Server mode |
134 | | - - [scalardb-sql-jdbc](https://scalar-labs.github.io/scalardb-sql/javadoc/jdbc/index.html) - ScalarDB SQL JDBC: JDBC Driver for ScalarDB SQL |
135 | | - - [scalardb-sql-cli](https://scalar-labs.github.io/scalardb-sql/javadoc/cli/index.html) - ScalarDB SQL CLI: ScalarDB SQL Command Line Interface |
136 | | - - [scalardb-sql-integration-test](https://scalar-labs.github.io/scalardb-sql/javadoc/integration-test/index.html) - ScalarDB SQL Integration test: Integration tests for ScalarDB SQL |
137 | | - - [scalardb-sql-spring-data](https://scalar-labs.github.io/scalardb-sql/javadoc/spring-data/index.html) - Spring Data JDBC for ScalarDB: Spring Data JDBC integration for ScalarDB |
| 1 | +--- |
| 2 | +tags: |
| 3 | + - Enterprise Premium |
| 4 | +displayed_sidebar: docsEnglish |
| 5 | +--- |
| 6 | + |
| 7 | +# ScalarDB SQL Overview |
| 8 | + |
| 9 | +ScalarDB SQL is an SQL layer for ScalarDB Cluster. Specifically, it parses SQL and converts it to a set of ScalarDB operations. |
| 10 | + |
| 11 | +:::note |
| 12 | + |
| 13 | +ScalarDB SQL is not fully compatible with standard SQL, but it offers a large subset of the SQL language. |
| 14 | + |
| 15 | +::: |
| 16 | + |
| 17 | +## Types of SQL interfaces |
| 18 | + |
| 19 | +ScalarDB SQL has three types of SQL interfaces. |
| 20 | + |
| 21 | +### JDBC |
| 22 | + |
| 23 | +The JDBC interface lets you connect to ScalarDB Cluster by using the standard JDBC API. This is useful for applications that already use JDBC. |
| 24 | + |
| 25 | +For details on how to set up and use the JDBC interface, see the [ScalarDB JDBC Guide](./jdbc-guide.mdx). |
| 26 | + |
| 27 | +### SQL API |
| 28 | + |
| 29 | +The SQL API lets you connect to ScalarDB Cluster by using the proprietary and modern Java SQL API. This is useful for applications that do not need to rely on the JDBC interface. |
| 30 | + |
| 31 | +For details on how to set up and use the SQL API, see the [ScalarDB SQL API Guide](./sql-api-guide.mdx). |
| 32 | + |
| 33 | +### Spring Data JDBC |
| 34 | + |
| 35 | +The Spring Data JDBC interface lets you interact with ScalarDB Cluster via Spring Data JDBC repositories and entities. This is useful for applications that already use Spring Data or when you want to integrate ScalarDB Cluster into Spring applications. |
| 36 | + |
| 37 | +For details on how to set up and use the Sprign Data JDBC interface, see the [Guide of Spring Data JDBC for ScalarDB](./spring-data-guide.mdx). |
0 commit comments