Use some kind of database in webextension firefox - firefox-addon-webextensions

Suppose i want to create some firefox extension like scrapBook and for storing scraped data use database like sqlite (what was possible in addon-sdk) is there any way to do this? The best solution for me is store information in sqlite. This addon, i plane to use myself, so don't have any security limitations, but still there must be a way to do it, as according to oficial documentation (or maybe i not look well) there is only IndexedDB with some size limitations.

Related

how to store data on client machine in Electron.js?

I am working on an electron project to keep inventory of a warehouse but I want to store the data on the client-side (on the client's desktop/laptop) and not on a cloud database. How do I do this? Is using an xlsx file a good idea to store the data. As it will come with an added bonus as the user can read the data outside the app if they want to in an excel sheet.
P. S: even if xslx is a way I would like to know other possible ways so I can choose which is more comfortable for me. Thank you.
Edit: sorry I forgot to mention that I might also have to store images in the data.
You have plenty of option. You can store json file and read it when application boot up. As this is node js related thing I would suggest you to use electron store
And xlsx is a good choice but that may be overkill if the thing you are storing is too simple. On windows you can store some settings in registry too. But I prefer the config version.
I have also used sqlite3 database for some app. In Android I believe many app uses sqlite approach to store local database.

dynamic databases created by users - django

I want to create a website where users can log in and create their own database (and also be able to manipulate them). These databases will be very small, and are ment to be used for testing mostly. Reading the suggested solutions here on SO it seems I have a few options:
dynamically add database to settings.py using a pre-defined functionality (as suggested here). I find this to be a very bad idea since it seems like a hack and exposes your own settings.py file.
store SQlite files in media, and connect to them using django.db.connections. This seems like a reasonable solution, though I have no idea how to execute it.
don't use an actual database but an XML or some other format for storing information, which will probably cost me in efficiency
my own idea, which might be crazy stupid - store SQlite files as blobs inside MySQL database.
The end-goal is to allow the users to create django models on the website and then perform queries on them (it's a learning website). Any ideas?
Slightly more than pseudocode, using fabric :)
from fabric import api
def django_start_project(project_name):
api.run('mkproject %s' % project_name) # Assumes you have virtualenvwrapper
with api.prefix('workon %s' % project_name):
api.run('pip install django')
api.run('django-admin.py startproject')
The last part needs some work of course, but this is the gist :)
Called like this:
fab django_start_project:your_project
Dependencies:
Fabric: http://docs.fabfile.org/
Virtualenv: http://www.virtualenv.org/
Virtualenvwrapper: http://virtualenvwrapper.readthedocs.org/

XBMC/Xbmcswift - Movie/TV-Show metadata

Is there a way for xbmcswift to automatically provide metadata for video items?
I know this is possible using a sqlite database, but is there a way to do this automatically without using a database/sqlite?
Possibly from websites like http://www.thetvdb.com/ and http://www.themoviedb.org/ ?
In short: No.
xbmcswift is just a wrapper for the XBMC add-on api and the api doesn't provide a possibility to interact with scraper add-ons.
However, there is the "script.module.metahandler" add-on you could use (by requiring it via addon.xml) to retrieve data from thetvdb and themoviedb - but it slows down extremely your add-on.

Symfony 2: Build own DB access layer

I'm new here and on a research trip. We would like to use Symfony2 for a new project.
Now we have the problem that we need to use a company wide self-developed DB access layer.
We don't want to lose the whole Symfony/Doctrine layer for handling data.
Our idea is now to create or overwrite database access layer below Doctrine.
Something like creating a bridge (like PDO) between Doctrine and our DB access layer.
Has anyone an idea how we can do this or maybe someone has done similar things already and can provide us with an how-to?
Please no questions why. We just have to use the company access layer!
Thank you
http://forum.symfony-project.org/viewtopic.php?f=23&t=37637
I found the solution in Doctrine2 doc. It's pretty easy.
I needed for development and testing (frontend and console) about half a day
I've done it in 4 steps:
copy Doctrine\DBAL\Driver\OCI8 to a new folder.
rename files.
change functions to use own database access layer.
add in config file
doctrine:
dbal:
driver_class: /Path/To/Driver/Class
Doctrine has not much but a bit of information about Abstraction Layer:
Supporting Other Databases
If you believe this ยง of the doctrine documentation, you can see that you may use the Common package because it does not require the DBAL. Sadly, the same thing cannot be said of the ORM package. The best thing to do is probably to fork this package so that it supports your own DBAL.
Condolences for being obliged to use this DBAL.

How save text, svg, html, css all together efficiently

In an application, I am using Fabric.js, which lets users write text, draw SVG's, insert images etc.
I want to know, what is the best way to store this data.
Requirements are:
Ability to query the data(text), which tells me that i should store it in DB (MySQL as of now)
I have images, and I am targeting IPad as well, so the images are important, as to how they are stored.
SVG's and HTML/CSS to be saved as well.
I also want to do versioning of the content, as Quora does it, so that a user can see the changes from the past version to the current version. This also includes the versioning of images and SVG's.
I am wondering how Google Docs does it, because they also store our documents, drawings etc.
What is the best way of doing this?
i dont known if it helps but, Opera browser offer an option to save the webpages to an unique file { mht extension }, this stores all the files { css, images, scripts, etc } in base64 encoded text for a later use { when the document is opened }... maybe this can be a way to store data :P
I manage a webapp where users generate reports, and found it more efficient to store images and binary files in the filesystem, and link to them from the database. Elements that are in xml or text are kept in the database for easier searching - in your case this would include css/html and svg (which is xml). Use the database for managing revisions.
Might also check out this thread on storing images in a database.
It looks like Frabic.js is using the node.js javascript webserver on the backend - haven't used this before, but you might investigate which databases are easiest to use with node.js:
node.js database
nodejs and database communication - how?
nodejs where to start?
If you want to query the text efficiently, then perhaps putting all bits of information into the DB separately is the most efficient. Maybe you with to play with OOXML or ODF, that may serve as container for all information you require, and then XML-storage (e.g. eXist) to store it and query (e.g. the text). As these standards are XML-based, you can transform them into HTML (e.g. here or here) but writing an online editor for this is something that monster like Google can do.
You can take a look at NoSQL databases like MongoDB or
CouchDB
See also Storing images in NoSQL stores

Resources