surrealdb/surrealdb.java
surrealdb/surrealdb.java has 90 GitHub stars and 28 forks. Star changes are not measured yet. Last checked 2026-11-14 04:45 UTC. Last push 2026-11-04.
What you can do
- A thread-safe native JAVA client for SurrealDB.
- Simple API: see docs.
- Support of 'memory' (embedded SurrealDB).
- Support of remote connection to SurrealDB.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
SurrealDB SDK for Java
데이터README.md
Original
The official SurrealDB SDK for Java
surrealdb.java
The official SurrealDB SDK for Java.
Documentation
View the SDK documentation here.
Features
- A thread-safe native JAVA client for SurrealDB.
- Simple API: see docs.
- Support of 'memory' (embedded SurrealDB).
- Support of remote connection to SurrealDB.
- Mutable POJOs (Java 8+) and immutable
recordclasses (JDK 16+) forcreate/select. - All geometry types (Point, LineString, Polygon, their multi-variants, and GeometryCollection) for reading and writing.
- Live queries: subscribe to table changes with
selectLiveand terminate them by id withkill. - Supported on JAVA JDK 8, 11, 17, 21, 25.
- Supported architectures:
- Linux (ARM) aarch64
- Linux (INTEL) x86_64
- Windows (INTEL) x86_64
- MacOS (ARM) aarch64
- MacOS (INTEL) x86_64
- Android (Linux ARM) aarch64
- Android (Linux INTEL) x86_64
- Zero dependencies
Minimum requirements
- Java 8
How to install
Stable release
Released to Maven Central.
Gradle:
ext {
surrealdbVersion = "2.2.0"
}
dependencies {
implementation "com.surrealdb:surrealdb:${surrealdbVersion}"
}
Maven:
<dependency>
<groupId>com.surrealdb</groupId>
<artifactId>surrealdb</artifactId>
<version>2.2.0</version>
</dependency>
Snapshot release
Published to the Maven Central snapshots repository on every push to main. Use it to try out unreleased changes.
Gradle:
repositories {
mavenCentral()
maven {
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
mavenContent { snapshotsOnly() }
}
}
ext {
surrealdbVersion = "2.1.2-SNAPSHOT"
}
dependencies {
implementation "com.surrealdb:surrealdb:${surrealdbVersion}"
}
Maven:
<repositories>
<repository>
<id>central-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.surrealdb</groupId>
<artifactId>surrealdb</artifactId>
<version>2.1.2-SNAPSHOT</version>
</dependency>
Getting started
package org.example;
import com.surrealdb.Surreal;
import com.surrealdb.RecordId;
import java.util.Iterator;
public class Example {
public static void main(String[] args) {
try (final Surreal driver = new Surreal()) {
// Connect to the instance
driver.connect("memory");
// namespace & database
driver.useNs("test").useDb("test");
// Create a person
Person person = new Person("Founder & CEO", "Tobie", "Morgan Hitchcock", true);
// Insert a record
List<Person> tobie = driver.create(Person.class, "person", person);
// Read records
Iterator<Person> people = driver.select(Person.class, "person");
// Print them out
System.out.println("Tobie = " + tobie);
System.out.println("people = " + people.next());
}
}
static class Person {
RecordId id;
String title;
String firstName;
String lastName;
boolean marketing;
// A default constructor is required
public Person() {
}
public Person(String title, String firstName, String lastName, boolean marketing) {
this.title = title;
this.firstName = firstName;
this.lastName = lastName;
this.marketing = marketing;
}
@Override
public String toString() {
return "Person{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", marketing=" + marketing +
'}';
}
}
}
Geometry
All GeoJSON-style geometry types are supported — Point, LineString, Polygon,
MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection — for both
reading and writing. Coordinates use java.awt.geom.Point2D.Double, where x is the
longitude and y is the latitude.
import com.surrealdb.Geometry;
import com.surrealdb.Surreal;
import com.surrealdb.Value;
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
try (final Surreal driver = new Surreal()) {
driver.connect("memory").useNs("test").useDb("test");
// Build a geometry in Java and store it via a bound parameter
Geometry route = Geometry.lineString(Arrays.asList(
new Point2D.Double(-0.118, 51.51),
new Point2D.Double(-0.121, 51.50)));
Map<String, Object> params = new HashMap<>();
params.put("route", route);
driver.query("UPSERT path:1 SET route = $route", params);
// Read it back
Value value = driver.query("SELECT VALUE route FROM path:1").take(0).getArray().get(0);
Geometry geom = value.getGeometry();
System.out.println(geom.getType()); // LineString
System.out.println(geom.getLineString()); // [Point2D.Double[...], Point2D.Double[...]]
}
Reports
Developing
On Linux/Mac:
cargo build
./gradlew -i test
On Windows:
cargo build
./gradlew.bat -i test
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,715 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,894 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,491 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,522 스타