-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(rust): initial work on rust (very broken)
- Loading branch information
1 parent
a217c57
commit 13ccad3
Showing
34 changed files
with
770 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -729,3 +729,5 @@ apps/.deps | |
.cargo/config.toml | ||
.cargo/config | ||
.github/scripts/deps | ||
dev.db | ||
dev.db-journal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "nexuscore" | ||
version = "0.1.0" | ||
license.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
documentation.workspace = true | ||
readme.workspace = true | ||
homepage.workspace = true | ||
authors.workspace = true | ||
|
||
[dependencies] | ||
nexus-prisma = { path = "../crates/prisma" } | ||
nexus-utils = { path = "../crates/utils"} | ||
|
||
tauri-specta.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::process::Command; | ||
|
||
fn main() { | ||
let output = Command::new("git") | ||
.args(["rev-parse", "--short", "HEAD"]) | ||
.output() | ||
.expect("error getting git hash. Does `git rev-parse --short HEAD` work for you?"); | ||
let git_hash = String::from_utf8(output.stdout) | ||
.expect("Error passing output of `git rev-parse --short HEAD`"); | ||
println!("cargo:rustc-env=GIT_HASH={git_hash}"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
-- CreateTable | ||
CREATE TABLE "instance" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"pub_id" BLOB NOT NULL, | ||
"node_id" BLOB NOT NULL, | ||
"node_name" TEXT NOT NULL, | ||
"node_platform" INTEGER NOT NULL, | ||
"last_run" DATETIME NOT NULL, | ||
"date_created" DATETIME NOT NULL, | ||
"timestamp" BIGINT | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Statistics" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"date_captured" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"java_version" TEXT NOT NULL DEFAULT '0', | ||
"operating_system" INTEGER NOT NULL DEFAULT 0 | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "object" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"pub_id" BLOB NOT NULL, | ||
"kind" INTEGER, | ||
"date_created" DATETIME, | ||
"date_accessed" DATETIME | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "job" ( | ||
"id" BLOB NOT NULL PRIMARY KEY, | ||
"name" TEXT, | ||
"action" TEXT, | ||
"status" INTEGER, | ||
"errors_text" TEXT, | ||
"data" BLOB, | ||
"metadata" BLOB, | ||
"parent_id" BLOB, | ||
"task_count" INTEGER, | ||
"completed_task_count" INTEGER, | ||
"estimated_completion" DATETIME, | ||
"date_created" DATETIME, | ||
"date_started" DATETIME, | ||
"date_completed" DATETIME, | ||
CONSTRAINT "job_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "job" ("id") ON DELETE SET NULL ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "preference" ( | ||
"key" TEXT NOT NULL PRIMARY KEY, | ||
"value" BLOB | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "notification" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"read" BOOLEAN NOT NULL DEFAULT false, | ||
"data" BLOB NOT NULL, | ||
"expires_at" DATETIME | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "instance_pub_id_key" ON "instance"("pub_id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "object_pub_id_key" ON "object"("pub_id"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "sqlite" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
datasource db { | ||
provider = "sqlite" | ||
url = "file:dev.db" | ||
} | ||
|
||
generator client { | ||
provider = "cargo prisma" | ||
output = "../../crates/prisma/src/prisma" | ||
module_path = "prisma" | ||
client_format = "folder" | ||
} | ||
|
||
/// @local(id: pub_id) | ||
model Instance { | ||
id Int @id @default(autoincrement()) // This is NOT globally unique | ||
pub_id Bytes @unique // This UUID exists solely for backwards compatibility. | ||
node_id Bytes | ||
node_name String | ||
node_platform Int | ||
last_run DateTime | ||
date_created DateTime | ||
timestamp BigInt? | ||
@@map("instance") | ||
} | ||
|
||
model Statistics { | ||
id Int @id @default(autoincrement()) | ||
date_captured DateTime @default(now()) | ||
java_version String @default("0") | ||
operating_system Int @default(0) | ||
} | ||
|
||
/// @shared(id: pub_id) | ||
model Object { | ||
id Int @id @default(autoincrement()) | ||
pub_id Bytes @unique | ||
kind Int? | ||
date_created DateTime? | ||
date_accessed DateTime? | ||
@@map("object") | ||
} | ||
|
||
model Job { | ||
id Bytes @id | ||
name String? | ||
action String? | ||
status Int? | ||
errors_text String? | ||
data Bytes? | ||
metadata Bytes? | ||
parent_id Bytes? | ||
task_count Int? | ||
completed_task_count Int? | ||
estimated_completion DateTime? | ||
date_created DateTime? | ||
date_started DateTime? | ||
date_completed DateTime? | ||
parent Job? @relation("jobs_dependency", fields: [parent_id], references: [id], onDelete: SetNull) | ||
children Job[] @relation("jobs_dependency") | ||
@@map("job") | ||
} | ||
|
||
/// @shared(id: key) | ||
model Preference { | ||
key String @id | ||
value Bytes? | ||
@@map("preference") | ||
} | ||
|
||
model Notification { | ||
id Int @id @default(autoincrement()) | ||
read Boolean @default(false) | ||
data Bytes | ||
expires_at DateTime? | ||
@@map("notification") | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[package] | ||
name = "generator" | ||
version = "0.1.0" | ||
license.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
documentation.workspace = true | ||
readme.workspace = true | ||
homepage.workspace = true | ||
authors.workspace = true | ||
|
||
[dependencies] | ||
reqwest.workspace = true | ||
clap.workspace = true | ||
anyhow.workspace = true | ||
serde.workspace = true | ||
serde_json.workspace = true | ||
cargo_metadata.workspace = true |
Oops, something went wrong.