How do I get started with creating custom Node Js driver to access a certain type of data - node.js

I have heard a lot about Node . Recently Microsoft released a driver for accessing SQL Server through Node. I would like to do similarly create a driver to access a data source we have. The data source can be accessed using their DLLs.
For e.g. I can write a c# program and access the data.
How do I create a driver to access our data source so Node can use it ?

You'd write driver code in C or C++ as described in the C/C++ Addons section of node's documentation. It would have to compile to native code, not managed .NET code.

Related

Windows Shell Namespace Extension from REST API

I'm working on a project which is an open-source cloud, similar to Nextcloud. It also provides a file upload and manage feature.
I'd like to have a shell namespace extension which displays those files and folders in the Windows Explorer. Moving, deleting, renaming and editing files / folders should be possible.
Data is available from a REST API or my Electron Client.
I know NodeJS and only some C#.
Is it possible whith NodeJS / Electron to create a shell namespace extension?
If not, are there any free libraries which make this task easier?
Windows Explorer uses 'COM' as its extension model. Therefore, technically speaking, you can use whatever you like, as long as it supports COM.
For NodeJS, you'd be dependent on the runtime to provide the COM support for you and to wrap the appropriate APIs. I'm not aware of any project that does this for the Windows Shell APIs. Here is one for the WinRT APIs.
For C# (.NET), again you'd be dependent on the runtime for COM support. .NET does expose that to you; although it is messy. There are a few projects which wrap the shell APIs and try to hide the COM interop goo as best they can for you.
Here is an open source one.
Here is a commercial one.
Be aware that Microsoft advises against building shell extensions which require a runtime (EG: .NET). The runtime may be loaded into processes that aren't expecting it. Therefore, in practice, Microsoft expects you to use C/C++ to build shell extensions. Here is the Microsoft supplied sample project. It is written in C++.

Swift SQLite Linux/Ubuntu

Wanting to give Swift a try and cheaply as possible.
I'm running
Ubuntu 16.04
SQLite 3.11.0
Swift 3.0-dev
All is working, not pretty though, but I'm having a hell of a time connecting to SQLite within Swift.
Has anyone successfully connected and run a query against SQLite with this setup?
While I've seen a bunch of post for iOS solutions I'm not entirely sure these will work on Ubuntu. I wasn't sure if you could or needed to compile Objective-C on Ubuntu.
Since Objective-C as used on Apple's platforms is not well supported on Linux, I think a better approach might be to access the SQLite C API from Swift by either using a system module or bridging header. You might also want to wrap the SQLite API in a C library exposing a subset of the API that you need in a simplified form more suitable to be called from Swift. You would then invoke the wrapper by creating a system module for it (no system module is needed in this case for the SQLite API) or by using a bridging header.
The following may help:
Compile C code and expose it to Swift under Linux
Linking a C library and its supporting library in Swift (linux)

How to set threading mode in SQLite with Entity Framework?

I'm using SQLite with Entity Framework Core (RC1).
I read, that SQLite supports three different threading modes: Single-thread, Multi-thread and Serialized.
How do I set in run-time, which mode I want to use with my database?
Microsoft.Data.Sqlite references the SQLitePCRaw.bundle_e_sqlite3 NuGet package. That package contains a version of SQLite that has been compiled with SQLITE_THREADSAFE=1 (Serialized). Microsoft.Data.Sqlite doesn't currently expose an API to change this, nor did System.Data.SQLite.
See also aspnet/EntityFramework#5466.
It is accomplished by opening a database with the appropriate flags set. SQLITE_OPEN_NOMUTEX for multithread or SQLITE_OPEN_FULLMUTEX for serialized. It looks like flag setting is available through the C interface:
https://www.sqlite.org/c3ref/c_open_autoproxy.html
So if you aren't using the C interface directly, you are at the mercy of EF and whether they have decided to support flag setting on database open.

Nodejs OLE-COM server

I am using win32ole to access COM-OLE (automation) bindings inside a windows PC such as excel, word etc.
Now what I want is to implement a COM-OLE server using nodejs. I can't seem to find any nodejs module that supports these.
In the end, I only need to expose COM-OLE objects/interfaces to any applications running inside the PC so that they can access my application.
Thanks and BTW, I am using Electron.js.
Since win32ole only appears to operate as a client, you're stuck either:
Implementing your own COM server in C++ (nan helps with the node glue)
Writing a COM server in .NET and using edge for the node glue.

core data editor problems

I was recommended by someone in Stack Overflow to use Core Data Editor http://christian-kienle.de/CoreDataEditor/ to manage the sqlite persistent store. However the latest version (3.0) crashes on launch everytime. Older versions load but I see nothing when i point the config to the persistent store and the object model directories. There is no documentation either.
can someone point me to the right place to sort this problem? I am trying to find a more manageable way to coordinate core data development than sqlite consoles.
thank you
You have to set the compiled model in Core Data Editor (ending in .moc, not the .xcdatamodel). You can find it in the resources folder of your app bundle.

Resources