Hi,
How to connect to a database? UseSQLiteDatabase () does not exist
Cleber
UseSQLiteDatabase()
-
- Posts: 220
- Joined: Sat Mar 01, 2014 3:02 pm
Re: UseSQLiteDatabase()
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.
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.
Re: UseSQLiteDatabase()
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.
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
As for client-side databases as the top creator asked about: You'll be using "localStorage" for client side databases, or you'll be using CGI scripts and SQL servers and POST.
-
- Posts: 220
- Joined: Sat Mar 01, 2014 3:02 pm
Re: UseSQLiteDatabase()
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.
Re: UseSQLiteDatabase()
Perl and PHP are more common especially with budget web hosting. 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.
I've seen some garbage collection and hardware benchmarks that suggest python has an advantage though. I personally like how python handles strings and objects better and the code looks cleaner in most editors.
I've seen some garbage collection and hardware benchmarks that suggest python has an advantage though. I personally like how python handles strings and objects better and the code looks cleaner in most editors.
-
- Posts: 220
- Joined: Sat Mar 01, 2014 3:02 pm
Re: UseSQLiteDatabase()
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.
Of course if you're running your SpiderBasic app on localhost or your LAN you can use whatever you prefer server side. I like Python because it's available for so many platforms (including Android and Sailfish) and if you're running on localhost you don't even need to install a separate web server, Python + Bottle can handle that too. If you're developing applications for your own usage being able to run them on all your devices is handy.
If you want the flexibility of configuring your own web server on the internet 1And1 offer some good value virtual servers.