@hakodb/client 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-quick.yml +31 -31
- package/.github/workflows/publish.yml +36 -0
- package/README.md +27 -37
- package/examples/bun/index.ts +85 -85
- package/examples/bun/package.json +10 -10
- package/examples/node/index.ts +111 -111
- package/examples/node/package-lock.json +533 -533
- package/examples/node/package.json +13 -13
- package/examples/node/softdel.ts +70 -70
- package/package.json +38 -34
- package/src/bun-ffi.d.ts +6 -6
- package/src/client.ts +1627 -1627
- package/src/index.ts +37 -37
- package/src/native.ts +1605 -1605
- package/sync-native.ps1 +55 -55
- package/tsconfig.json +12 -12
package/sync-native.ps1
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
#Requires -Version 5.1
|
|
2
|
-
<#
|
|
3
|
-
.SYNOPSIS
|
|
4
|
-
Populate native/ from a core checkout or a release tag asset (multi-platform).
|
|
5
|
-
.EXAMPLE
|
|
6
|
-
.\sync-native.ps1 -CoreDir C:\Dev\libs\hakodb
|
|
7
|
-
.\sync-native.ps1 -Tag v0.9.0
|
|
8
|
-
.\sync-native.ps1 -Tag v0.9.0 -Platform linux
|
|
9
|
-
#>
|
|
10
|
-
param(
|
|
11
|
-
[string]$CoreDir = "",
|
|
12
|
-
[string]$Tag = "",
|
|
13
|
-
[string]$Platform = "",
|
|
14
|
-
[string]$LibTag = "linux-glibc2.28-el8"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
$ErrorActionPreference = "Stop"
|
|
18
|
-
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
19
|
-
$Native = Join-Path $Root "native"
|
|
20
|
-
New-Item -ItemType Directory -Force $Native | Out-Null
|
|
21
|
-
|
|
22
|
-
# No macOS prebuilts (no CI job yet): build from source via -CoreDir on a Mac.
|
|
23
|
-
|
|
24
|
-
if ($CoreDir -ne "") {
|
|
25
|
-
$dll = Join-Path $CoreDir "target\release\hakodb.dll"
|
|
26
|
-
$so = Join-Path $CoreDir "target\release\libhakodb.so"
|
|
27
|
-
$dylib = Join-Path $CoreDir "target\release\libhakodb.dylib"
|
|
28
|
-
$found = @($dll, $so, $dylib) | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
29
|
-
if (-not $found) { throw "no release library under $CoreDir\target\release (cargo build --release first)" }
|
|
30
|
-
Copy-Item $found $Native -Force
|
|
31
|
-
Write-Output "synced from checkout: $CoreDir"
|
|
32
|
-
} elseif ($Tag -ne "") {
|
|
33
|
-
if ($Platform -eq "") {
|
|
34
|
-
if ($IsWindows -or $env:OS -eq "Windows_NT") { $Platform = "win32" }
|
|
35
|
-
elseif ($IsLinux) { $Platform = "linux" }
|
|
36
|
-
elseif ($IsMacOS) { $Platform = "darwin" }
|
|
37
|
-
else { $Platform = "win32" }
|
|
38
|
-
}
|
|
39
|
-
$base = "https://github.com/hakodb/hakodb/releases/download/$Tag"
|
|
40
|
-
if ($Platform -eq "win32") {
|
|
41
|
-
Invoke-WebRequest -Uri "$base/hakodb-x86_64-pc-windows-msvc.dll" -OutFile (Join-Path $Native "hakodb.dll")
|
|
42
|
-
} elseif ($Platform -eq "linux") {
|
|
43
|
-
# el8 build runs on glibc >= 2.28 everywhere; override -LibTag for an exact distro.
|
|
44
|
-
Invoke-WebRequest -Uri "$base/libhakodb-x86_64-unknown-$LibTag.so" -OutFile (Join-Path $Native "libhakodb.so")
|
|
45
|
-
} elseif ($Platform -eq "android") {
|
|
46
|
-
Invoke-WebRequest -Uri "$base/libhakodb-aarch64-linux-android.so" -OutFile (Join-Path $Native "libhakodb.so")
|
|
47
|
-
} elseif ($Platform -eq "darwin") {
|
|
48
|
-
throw "no macOS prebuilt (no CI job yet) - build from source and use -CoreDir on a Mac"
|
|
49
|
-
} else {
|
|
50
|
-
throw "unknown -Platform '$Platform' (win32|linux|android|darwin)"
|
|
51
|
-
}
|
|
52
|
-
Write-Output "synced from release asset: $Tag ($Platform)"
|
|
53
|
-
} else {
|
|
54
|
-
throw "pass -CoreDir or -Tag"
|
|
55
|
-
}
|
|
1
|
+
#Requires -Version 5.1
|
|
2
|
+
<#
|
|
3
|
+
.SYNOPSIS
|
|
4
|
+
Populate native/ from a core checkout or a release tag asset (multi-platform).
|
|
5
|
+
.EXAMPLE
|
|
6
|
+
.\sync-native.ps1 -CoreDir C:\Dev\libs\hakodb
|
|
7
|
+
.\sync-native.ps1 -Tag v0.9.0
|
|
8
|
+
.\sync-native.ps1 -Tag v0.9.0 -Platform linux
|
|
9
|
+
#>
|
|
10
|
+
param(
|
|
11
|
+
[string]$CoreDir = "",
|
|
12
|
+
[string]$Tag = "",
|
|
13
|
+
[string]$Platform = "",
|
|
14
|
+
[string]$LibTag = "linux-glibc2.28-el8"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
$ErrorActionPreference = "Stop"
|
|
18
|
+
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
19
|
+
$Native = Join-Path $Root "native"
|
|
20
|
+
New-Item -ItemType Directory -Force $Native | Out-Null
|
|
21
|
+
|
|
22
|
+
# No macOS prebuilts (no CI job yet): build from source via -CoreDir on a Mac.
|
|
23
|
+
|
|
24
|
+
if ($CoreDir -ne "") {
|
|
25
|
+
$dll = Join-Path $CoreDir "target\release\hakodb.dll"
|
|
26
|
+
$so = Join-Path $CoreDir "target\release\libhakodb.so"
|
|
27
|
+
$dylib = Join-Path $CoreDir "target\release\libhakodb.dylib"
|
|
28
|
+
$found = @($dll, $so, $dylib) | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
29
|
+
if (-not $found) { throw "no release library under $CoreDir\target\release (cargo build --release first)" }
|
|
30
|
+
Copy-Item $found $Native -Force
|
|
31
|
+
Write-Output "synced from checkout: $CoreDir"
|
|
32
|
+
} elseif ($Tag -ne "") {
|
|
33
|
+
if ($Platform -eq "") {
|
|
34
|
+
if ($IsWindows -or $env:OS -eq "Windows_NT") { $Platform = "win32" }
|
|
35
|
+
elseif ($IsLinux) { $Platform = "linux" }
|
|
36
|
+
elseif ($IsMacOS) { $Platform = "darwin" }
|
|
37
|
+
else { $Platform = "win32" }
|
|
38
|
+
}
|
|
39
|
+
$base = "https://github.com/hakodb/hakodb/releases/download/$Tag"
|
|
40
|
+
if ($Platform -eq "win32") {
|
|
41
|
+
Invoke-WebRequest -Uri "$base/hakodb-x86_64-pc-windows-msvc.dll" -OutFile (Join-Path $Native "hakodb.dll")
|
|
42
|
+
} elseif ($Platform -eq "linux") {
|
|
43
|
+
# el8 build runs on glibc >= 2.28 everywhere; override -LibTag for an exact distro.
|
|
44
|
+
Invoke-WebRequest -Uri "$base/libhakodb-x86_64-unknown-$LibTag.so" -OutFile (Join-Path $Native "libhakodb.so")
|
|
45
|
+
} elseif ($Platform -eq "android") {
|
|
46
|
+
Invoke-WebRequest -Uri "$base/libhakodb-aarch64-linux-android.so" -OutFile (Join-Path $Native "libhakodb.so")
|
|
47
|
+
} elseif ($Platform -eq "darwin") {
|
|
48
|
+
throw "no macOS prebuilt (no CI job yet) - build from source and use -CoreDir on a Mac"
|
|
49
|
+
} else {
|
|
50
|
+
throw "unknown -Platform '$Platform' (win32|linux|android|darwin)"
|
|
51
|
+
}
|
|
52
|
+
Write-Output "synced from release asset: $Tag ($Platform)"
|
|
53
|
+
} else {
|
|
54
|
+
throw "pass -CoreDir or -Tag"
|
|
55
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"types": ["node"]
|
|
10
|
-
},
|
|
11
|
-
"include": ["src"]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"types": ["node"]
|
|
10
|
+
},
|
|
11
|
+
"include": ["src"]
|
|
12
|
+
}
|