UseSQLiteDatabase()
Posted: Tue Jun 02, 2015 2:42 pm
Hi,
How to connect to a database? UseSQLiteDatabase () does not exist
Cleber
How to connect to a database? UseSQLiteDatabase () does not exist
Cleber
I'm not sure how any of this relates to the topic creator's question. You're describing doing back-end scripting and building python, and they are asking about databases.the.weavster wrote:Connecting to a database would happen server side, SpiderBasic is really for the client side.
I've created a few simple test apps using Python3 + Bottle to create a JSON-RPC server and SpiderBasic to create the UI. I've then run them on my Linux Mint laptop and Jolla smartphone without changes which is quite pleasing.
I haven't tested it yet but I don't see any reason why it shouldn't be possible to use cx_Freeze to create a self-contained SpiderBasic application this way.
Then try reading my first sentence again.tj1010 wrote:I'm not sure how any of this relates to the topic creator's question. You're describing doing back-end scripting and building python, and they are asking about databases.
I wouldn't do anything like this.tj1010 wrote:The truth about app back-ends is if you're going to have a large user-base and real-time communications with the back-end there is no profitable way to do this. HTTP hosting, except for dedicated servers with some hosts, don't allow long-polling or sockets for HTML5 websockets and request hanging. Most dedicated hosts will shut you down the day you start opening sockets or modifying HTTP headers and chunking requests.
If you do deep research on the subject, like I have, you'll end up using something like parse.com
Actually you'd probably use IndexedDB for a client side database not LocalStorage because IndexedDB gives you indexing, transactions and object storage rather than just a simple key/value store. The problem with either is it's so easy for the user to accidentally wipe all the data.tj1010 wrote:As for client-side databases as the top creator asked about: You'll be using "localStorage" for client side databases
Or, as I said before, you can create a JSON-RPC server using Python + Bottle. The database could be a SQL server or it could just be SQLite but the data access would be by Python not by SpiderBasic.tj1010 wrote:, or you'll be using CGI scripts and SQL servers and POST.
With Python it's more common to use WSGI rather than CGI but if you use Bottle there are lots of options for deployment.tj1010 wrote:Python CGI and PHP are easier to code than Perl and probably require less lines&bytes. All have JSON handling and can handle AJAX transparently.