Spatial index in Berkeley DB - berkeley-db

Does Berkeley DB have a spatial index such as R-tree?

On some other page however you can read that spatial indices are possible. It's because BerkeleyDB has its SQL interface binary compatible with SQLite's interface so you can use anything which is built on top of that. SQLite's R*-trees and full text search are just two examples.

Someone's asking the same question on the Oracle forum. No Oracle answer yet. But the answer is no, it doesn't have any built-in spatial index functionality. Berkeley DB is a low-level database offering basic functionality which you can build upon. The building blocks are Btree, Hash, Queue and Recno. I don't doubt that a determined programmer could implement spatial indices using those. ;-)

Related

How Couchbase Lite use SQlite for NoSQL data

While SQLite is for relationnal database, how couchbase use it for NoSQL data queryable ?
Couchbase Lite can use different storage engines internally.
In the SQLite case, the main document body is stored as a blob. Most of the data in the tables actually has to do with tracking revisions, views, supporting sync (replication), and so on. (This is as of version 1.4.0.)
So, to answer what I think is the main point of your question, CBL isn't turning documents into tables the way you would if you were trying to store the data directly in SQLite.
These are, of course, implementation details you should not rely on. If you're interested in finding out more, you can look at the source (Couchbase is open source) and use standard SQLite tools to examine the database itself.

Can I link to Business Objects universe in R?

Is it possible to link to a Business Objects Universe in R?
I can connect R to a SQL database but that doesn't give me the Universe where all the joins are already created. I have end users that currently get there data through Business Objects but R would better suit their needs. And, since they are already familiar with field names and how the tables are linked in Business Objects, I would like for them to just link R to the existing BOBj universe.
Thanks!
Since I'm not allowed to recommend specific software (new to me, but fair is fair :)) I'll just mention two options:
1) search the internet for software that gives odbc access to business objects universes. These are good keywords on my favorite search engine: 'odbc leverages SAP BusinessObjects Security'
It has the distinct advantage of making sure that all user access is being governed by business objects, but data will have to travel through that server, and you will need to pay for licenses to SAP as well as the vendor of the new odbc...
2) give the users in question ODBC access to the same tables that the BO reports/universe run against, and make sure they are allowed to see the SQL in their dataproviders. Then tell them to 'cook up a report, and the copy&paste the SQL to R'
Option two may save you some licenses and give you better performance, but I would personally go for option 1) :)

How to replace SQLite with Berkeley DB

Currently I have developed a c# project with Sqlite3. I need to replace Sqlite3 with Berkeley DB.
I need to know the followings,
Is it possible to replace? if yes, what should we follow?
Please advice.
Thank you.
There's an easy way and a hard way to replace sqlite3 with BerkeleyDB.
The easy way is to replace the sqlite3 libraries with the sqlite3 wrapper library (part of modern Berkeley DB) that uses BerkeleyDB as the data store engine under a modified sqlite3 (it's exactly a sqlite3 API).
The harder implementation would be to rewrite the SQL methods to use Berkeley DB. Since Berkeley DB is basically a NoSQL! key->value store, you will likely need to think about whether your schema is simple enough to justify the work involved.

Sqlite database documentation templates / software?

I need to write documentation for several small sqlite databases. Want to describe how the data is used, including table and row descriptions and sample data.
Is it possible to use MySQL Workbench? If not are there any alternatives, or any templates I could work from?
TIA!
Using MySQL Workbench is not possible since, as far as I know, it only supports exporting to SQLite. For a number of suggestions about free database managers you might want to take a look at What are good open source GUI SQLite database managers? - a number of the GUIs mentioned there support report generation.
Definitely far more feature rich, but with a significant price tag, is Navicat for SQLite, which is an excellent database manager with report generation features.

Creating stored procedure in SQLite

Is it somehow possible to create a stored procedure when using SQLite?
SQLite has had to sacrifice other characteristics that some people find useful, such as high concurrency, fine-grained access control, a rich set of built-in functions, stored procedures, esoteric SQL language features, XML and/or Java extensions, tera- or peta-byte scalability, and so forth
Source : Appropriate Uses For SQLite
Answer: NO
Here's Why ... I think a key reason for having stored procs in a database is that you're executing SP code in the same process as the SQL engine. This makes sense for database engines designed to work as a network connected service but the imperative for SQLite is much less given that it runs as a DLL in your application process rather than in a separate SQL engine process. So it makes more sense to implement all your business logic including what would have been SP code in the host language.
You can however extend SQLite with your own user defined functions in the host language (PHP, Python, Perl, C#, Javascript, Ruby etc). You can then use these custom functions as part of any SQLite select/update/insert/delete. I've done this in C# using DevArt's SQLite to implement password hashing.
Chris Wolf made a prototype implementation of SQLite with stored procedures. You can find the details at his blog post: Adding Stored Procedures to SQLite
Yet, it is possible to fake it using a dedicated table, named for your fake-sp, with an AFTER INSERT trigger. The dedicated table rows contain the parameters for your fake sp, and if it needs to return results you can have a second (poss. temp) table (with name related to the fake-sp) to contain those results. It would require two queries: first to INSERT data into the fake-sp-trigger-table, and the second to SELECT from the fake-sp-results-table, which could be empty, or have a message-field if something went wrong.
No, but you can :
Write long multi-statement scripts
Create temporary one-row tables called e.g. Vars to hold variables
Create a View over a Recursive CTE to program arbitrary functions in pure SQL queries.
So you can do most things you would normally do with stored procs.
For how to program functions in a SQL View see https://www.cafe-encounter.net/p3300/pretending-that-sqlite-has-stored-procedures-and-functions.
Alternatively you can:
Compile short single-page C programs to program arbitrary functions
This is easier and less work than you might think!
A step-by-step guide is at https://www.cafe-encounter.net/p3244/installing-and-using-sqlite-extensions-on-macos-and-maybe-windows-linux-too . This does add some deployment work: you will have to deploy the additional dll/so/dylib files with your application.
I've come across this question myself. I think stored procedures are supported in PHP PDO, but that module is handling it and building normal SQL queries to send to SQLite. So, in PHP, possible to write stored procedures in your code, but no performance gain from using them.
Correct me if I'm wrong, please.

Resources