Closed gcaplan closed 2 years ago
Thanks for reporting. ~But where is this ObjectBoxInstallScript.ps1
script from?~
The Powershell install script from this repo appears to download from the correct URL. See also https://golang.objectbox.io/install#windows Edit: the script linked from the docs page was outdated.
As for selecting/querying see https://golang.objectbox.io/queries
At the cost of storage a query on a specific property can be sped up by indexing it.
Uwe
Thanks - the script you sent me has run correctly.
From memory, the install script that failed was downloaded off a link in the getting started docs for the Go driver, but I may be wrong. I've included the code below.
You may want to track this down and get it fixed...
Geoff
remove the space in the following to require running this script as
administrator
Requires -RunAsAdministrator
$ErrorActionPreference = "Stop"
[Net.ServicePointManager]::SecurityProtocol =
function DownloadLibrary { $libVersion = '0.13.0' $downloadDir = 'download'
# Windows hashes and URL sourced from objectbox-c download.sh
$hash = if ([Environment]::Is64BitOperatingSystem) {
"ca33edce272a279b24f87dc0d4cf5bbdcffbc187" } else { "11e6a84a7894f41df553e7c92534c3bf26896802" } $remoteRepo = ' https://dl.bintray.com/objectbox/conan/objectbox/objectbox-c' $repoType = 'testing' $url = "$remoteRepo/$libVersion/$repoType/0/package/$hash/0/conan_package.tgz"
$archiveFile = "$downloadDir\objectbox-$libVersion.tgz"
$targetDir = "$downloadDir\objectbox-$libVersion"
if (!(Test-Path $downloadDir -PathType Container)) {
Write-Host "Creating download directory $downloadDir"
New-Item $downloadDir -ItemType directory
}
Write-Host "Downloading C-API v$libVersion into $archiveFile"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $archiveFile)
if (!(Test-Path $targetDir -PathType Container)) {
New-Item $targetDir -ItemType directory
}
Write-Host "Extracting into $targetDir"
tar -xzf "$archiveFile" -C "$targetDir"
# ls -r
# Get-ChildItem -Recurse $targetDir
return $targetDir
}
function ValdiateInstallation { param ($sourceFile, $targetFile)
if ((Get-Item $sourceFile).Length -eq (Get-Item $targetFile).Length) {
Write-Host "Succesfully installed $targetFile" -ForegroundColor
Green } else { throw "Installation to $targetFile failed - source and target contents don't match" } }
function InstallWithPrompt { param ($downloadDir, $libDir)
$reply = Read-Host -Prompt "Would you like to install ObjectBox library
into $($libDir)? [y/N]" if (!($reply -match "[yY]")) { Write-Host "OK, skipping installation to $libDir" return }
$sourceFile = "$downloadDir\lib\objectbox.dll"
$targetFile = "$libDir\objectbox.dll"
Write-Host "Copying $sourceFile to $libDir"
try {
Copy-Item $sourceFile $libDir
ValdiateInstallation $sourceFile $targetFile
return
} catch [System.UnauthorizedAccessException] {
Write-Host "Can't copy: $($_.Exception.Message)" -ForegroundColor
Yellow }
# reaches here only when copying fails because of
UnauthorizedAccessException $reply = Read-Host -Prompt "Would you like to retry as adminstrator? [y/N]" if (!($reply -match "[yY]")) { Write-Host "OK, skipping installation to $libDir" return }
$sourceFile = "$pwd\$sourceFile" # sub-shell requires an asbolute path.
-WorkingDirectory argument doesn't work either. $expectedSize = (Get-Item $sourceFile).Length $verifyCmd = "if ((Get-Item $targetFile).Length -ne $expectedSize) {Write-Host 'Installation failed.'; Read-Host -Prompt 'Press any key to exit this window'}" $cmd = "Copy-Item $sourceFile $libDir ; $verifyCmd" Start-Process powershell.exe -Verb runas -ArgumentList $cmd
ValdiateInstallation $sourceFile $targetFile
}
function InstallIntoGCC { param ($downloadDir)
Write-Host "Determining path to your local GCC installation - necessary
for compiling your programs with ObjectBox"
$libDir = "."
try {
# try to find gcc
$gcc = Get-Command gcc
Write-Host "Found GCC: $($gcc.Path)"
$libDir = Split-Path $gcc.Path -Parent
$libDir = Split-Path $libDir -Parent
$libDir = Join-Path $libDir "lib"
}
catch {
Write-Host "GCC installation not found, skipping"
return
}
InstallWithPrompt $downloadDir $libDir
}
function InstallIntoSys32 { param ($downloadDir)
Write-Host "Windows needs to find your library during runtime (incl.
tests execution)." Write-Host "The simplest way to achieve this is to install the library globally." InstallWithPrompt $downloadDir "C:\Windows\System32" }
try { $downloadDir = DownloadLibrary Write-Host ""
InstallIntoGCC $downloadDir
Write-Host ""
InstallIntoSys32 $downloadDir
Write-Host ""
Write-Host "Installation complete" -ForegroundColor Green
} catch { Write-Error $error[0].Exception -ErrorAction Continue }
Read-Host -Prompt 'Press any key to exit'
On Mon, 17 Jan 2022 at 07:40, Uwe - ObjectBox @.***> wrote:
Thanks for reporting. But where is this ObjectBoxInstallScript.ps1 script from?
The Powershell install script https://github.com/objectbox/objectbox-go/blob/main/install.ps1 from this repo appears to download from the correct URL. See also https://golang.objectbox.io/install#windows
As for selecting/querying see https://golang.objectbox.io/queries
At the cost of storage a query on a specific property can be sped up by indexing it https://golang.objectbox.io/entity-annotations#basic-annotations-for-entity-properties .
— Reply to this email directly, view it on GitHub https://github.com/objectbox/objectbox-go/issues/38#issuecomment-1014223748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADO7QDFPWIVJTEUMKWITVLUWPBWLANCNFSM5L5BCTDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
Hi Uwe
I've hit another issue. I'm not a C developer so I'm not clear if this is a bug or simply that I'm misunderstanding something.
I've posted the details here:
https://github.com/objectbox/objectbox-go/issues/39
Please take a look as soon as convenient.
Geoff
On Mon, 17 Jan 2022 at 07:40, Uwe - ObjectBox @.***> wrote:
Thanks for reporting. But where is this ObjectBoxInstallScript.ps1 script from?
The Powershell install script https://github.com/objectbox/objectbox-go/blob/main/install.ps1 from this repo appears to download from the correct URL. See also https://golang.objectbox.io/install#windows
As for selecting/querying see https://golang.objectbox.io/queries
At the cost of storage a query on a specific property can be sped up by indexing it https://golang.objectbox.io/entity-annotations#basic-annotations-for-entity-properties .
— Reply to this email directly, view it on GitHub https://github.com/objectbox/objectbox-go/issues/38#issuecomment-1014223748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADO7QDFPWIVJTEUMKWITVLUWPBWLANCNFSM5L5BCTDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
Running ObjectBoxInstallScript.ps1 on Windows 10 Pro is failing.
Attempting to access
https://dl.bintray.com/objectbox/conan/objectbox/objectbox-c
returns a 502 Bad Gateway error.Looks like a great project and I'm keen to get ObjectBox up and running for an urgent evaluation. Please advise on how I can get my hands on the .dll as I can't spot it on the open web.
While I'm in contact, my requirement is to select a subset of objects sorted by integer key from a set of some millions in a flat table.
It's not clear from a quick scan of the docs how ObjectBox handles sorting internally.
SQLite has a sorted index, and I'm getting reasonable results.
To be sure it's worth the effort of setting up a test, is there a reasonable chance that ObjectBox would give me equal or better performance on these large sorted selects? The insertions will not be made in index sequence.
All being equal, I'd prefer ObjectBox to SQLite because of the faster ingestion provided the select queries would at least match the SQLite performance.