HTML5 and Databases

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

HTML5 and Databases

Post by egolombek » Wed Sep 30, 2020 7:25 pm

I read a post from 2013 that basically said that there was no way to connect HTML implementation to a database, but that this was a feature that was surely coming. But, I do not seem to see any documentation of this change actually having taken place. Has it? What exactly is the point of a website that cannot interact with data?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8280
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 and Databases

Post by FourthWorld » Wed Sep 30, 2020 8:29 pm

There are many ways to work with data without exposing the full power of a DB scripting language to the open Internet. If direct DB access still isn't in the HTML exporter it's likely because it's an obscure use-case seldom done.

Most data worth working with is worth protecting, and the server itself is worth protecting (it's a more sought-after resource for the bad guys than your data, unless you happen to have uncommonly valuable data).

Use REST APIs to not only streamline development in the client, but also to serve as a buffer to protect the DB.

You can write an API in PHP, Perl, Python, Ruby, or LiveCode.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: HTML5 and Databases

Post by egolombek » Thu Oct 01, 2020 4:47 am

So, FourthWorld, your reply leaves me both hopeful and totally confused. (Remember this is the board for complete beginners!) I understood about 50% of what you wrote...
There are many ways to work with data without exposing the full power of a DB scripting language to the open Internet. If direct DB access still isn't in the HTML exporter it's likely because it's an obscure use-case seldom done. Most data worth working with is worth protecting, and the server itself is worth protecting (it's a more sought-after resource for the bad guys than your data, unless you happen to have uncommonly valuable data).
So what your saying is the revDatabase functions are good for applications, but would be vulnerable on-line?

Use REST APIs to not only streamline development in the client, but also to serve as a buffer to protect the DB.
You can write an API in PHP, Perl, Python, Ruby, or LiveCode.
I don't know what a REST API is, nor how I would use or build one. I am storing my data on a service called CleverCloud -- I assume they would have an API I could use, but I have no idea how I would do so. Are there any lessons, tutorials or documentation about this? (Or is this another one of those things LiveCode would prefer not document so that users will struggle?)

I appreciate any help.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8280
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 and Databases

Post by FourthWorld » Thu Oct 01, 2020 5:24 pm

egolombek wrote:
Thu Oct 01, 2020 4:47 am
I am storing my data on a service called CleverCloud -- I assume they would have an API I could use, but I have no idea how I would do so. Are there any lessons, tutorials or documentation about this?
I'm unfamiliar with CleverCloud so I'm unable to provide specific guidance on that. How does CleverCloud recommend connecting to their databases?
(Or is this another one of those things LiveCode would prefer not document so that users will struggle?)
I'm going to try to write this as respectfully as I can, certainly with more respect than you have demonstrated to the LC team:

This last question is not only unnecessary and unproductive, but also demonstrates how much remains in your journey to understand how software development works.

Communication between programs over the Internet generally use Unix sockets. The most common socket-based protocol is HTTP, which is highly recommended for communications with databases.

LC provides good documentation and numerous examples for using both sockets and HTTP. And for the most commonly used services, like AWS, OAuth2, some Google APIs, and others, they also provide convenient wrappers for those, and those are documented.

But given the many tens of thousands of services available to developers, LC cannot provide specific tooling and documentation for each one of them.

What you are asking there is simply not practical.

A good general rule in any professional forum is to address the reader as though you're speaking with the across the table at a business meeting. If you were sitting across from the LiveCode team, I'm confident their intelligence and good nature would be self-evident enough that you would have no temptation to speak to them like that.

So let's reboot this:

Please review the documentation for the database service you've chosen, learn it using the examples and tools they provide, and if you have difficulty using what you've learned in LC we can help you with that.

If you find that vendor's service difficult to use, you may also consider LiveCloud, a database service designed by a third party (Canela Software) with libraries specifically for LC users.
https://livecloud.io/
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

egolombek
Posts: 74
Joined: Thu Jan 30, 2020 2:11 pm

Re: HTML5 and Databases

Post by egolombek » Fri Oct 02, 2020 6:26 am

I apologize, FourthWorld, I can see that your feelings were hurt, and definitely no offense was intended. My comment echoed the reply I have myself received on this forum and have seen on this forum about LiveCode's approach to documentation. For example, I asked if there was documentation of which libraries are needed to be included in standalones for which commands. In my mind, this would appear naturally in the dictionary. However, to the best of my searches and of the people on this forum (and please tell me if you know otherwise), this is not documented at all. I was told that the LiveCode developers have a philosophy of "figure it out". If you are saying that that is not the case, then great. I have no way of knowing as, as the forum is titled, I am really a beginner.

I have benefited from this forum, for sure, and greatly appreciate the help that people freely give. The LiveCode community is clearly a passionate and sharing community and it is amazing. LiveCode itself is amazing -- I am glad I stumbled on it about a year ago after a hiatus of programming of over twenty years. I am probably one of the biggest advocates of LC in a country that I have yet to find a single other users. I am beginning to teach it to kids, and hopefully one day there will be a community here as well.

As for the specific questions I asked, I asked if the reason revDatabase questions do not work is because they are vulnerable. I am asking not sarcastically, but because I do not know.

I also said that I don't know what a rest API is. Is it different than a regular API (of which I know almost nothing about)? Can you use an API with SQL? I am asking these things because I don't know. I also don't know what a "wrapper" is either. Again, I am a beginner. If you are aware of any documentation that can help a beginner figure this out, I would be grateful. Basically, I have a working desktop application that use the various revDatabase commands to access a cloud database. I want to build a cloud version and do not know where to begin.

(And if you find such a question in any way sarcastic or offensive, again my apologies... definitely not intended).

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5775
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: HTML5 and Databases

Post by jacque » Fri Oct 02, 2020 6:03 pm

I was told that the LiveCode developers have a philosophy of "figure it out".
This is the primary reason why I bristle when disgruntled users post negative, unthoughtful things about the team. Frequently those who object to those posts are accused of being slavish fanbois. But there are people on this forum who continue to air accusations based on their own frustrations without understanding how the LC team works and how they prioritize their efforts.

There are a couple of people in particular whom I've written to privately asking them to stop, not because I think their complaints aren't valid for them, but because the effect of their public posts will discourage new users or give a distorted view of the team. This is what has happened to you. Until you know the participants better, it is natural to believe whatever anyone says.

I have no objection to considered feedback of known issues, and I know the team wants to correct any problems. They are a dedicated bunch who truly want to provide the best possible product. But opinions that they don't care, or that they want to make life more difficult for their users, are not only untrue but harmful. And it spreads like a virus. Humans like to believe the worst.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8280
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: HTML5 and Databases

Post by FourthWorld » Fri Oct 02, 2020 8:06 pm

egolombek wrote:
Fri Oct 02, 2020 6:26 am
I apologize, FourthWorld, I can see that your feelings were hurt, and definitely no offense was intended.
None taken. My interest isn't that it was insulting, but that it was unproductive. I, like the other volunteers here, would like to help you. As in any other aspect of life, assumptions of good intentions among the people we work with go a long way to engendering help from them.
My comment echoed the reply I have myself received on this forum and have seen on this forum about LiveCode's approach to documentation. For example, I asked if there was documentation of which libraries are needed to be included in standalones for which commands. In my mind, this would appear naturally in the dictionary. However, to the best of my searches and of the people on this forum (and please tell me if you know otherwise), this is not documented at all. I was told that the LiveCode developers have a philosophy of "figure it out". If you are saying that that is not the case, then great. I have no way of knowing as, as the forum is titled, I am really a beginner.
Someone misled you. I don't know who it was, and I don't need to know. But life has taught me it's a safe bet that someone with such an approach probably complains about many things. I've found an inverse correlation between complaining and business success. I'd like to help you succeed with LiveCode.

The Dictionary is a great place to find details on specific words in the language. But for general usage guidance, such as managing inclusions, see the User Guide included in the package, available near the top of the Help menu. The section on "Deploying Your Application" begins on page 509, and the details on inclusions begin on page 514.
I have benefited from this forum, for sure, and greatly appreciate the help that people freely give. The LiveCode community is clearly a passionate and sharing community and it is amazing. LiveCode itself is amazing -- I am glad I stumbled on it about a year ago after a hiatus of programming of over twenty years. I am probably one of the biggest advocates of LC in a country that I have yet to find a single other users. I am beginning to teach it to kids, and hopefully one day there will be a community here as well.
Welcome aboard. I think you'll find working with LiveCode a rewarding and enjoyable experience.
As for the specific questions I asked, I asked if the reason revDatabase questions do not work is because they are vulnerable. I am asking not sarcastically, but because I do not know.

I also said that I don't know what a rest API is. Is it different than a regular API (of which I know almost nothing about)? Can you use an API with SQL? I am asking these things because I don't know. I also don't know what a "wrapper" is either. Again, I am a beginner. If you are aware of any documentation that can help a beginner figure this out, I would be grateful. Basically, I have a working desktop application that use the various revDatabase commands to access a cloud database. I want to build a cloud version and do not know where to begin.
We're in a great moment in history, but also a difficult one. The Internet has opened up countless new opportunities for collaboration, but the world also has bad actors who spend tremendous amounts of time and resources trying to undo what honest people are doing. So caution is strongly warranted, for all Internet users.

Developers have an additional responsibility. We are asked to protect user data, and the compute resources like servers that manage that data. It's not a small task, unfortunately, and good protection is best done by those who enjoy ongoing study.

It sounds like you may be better suited for a managed service rather than one where you're taking on more responsibility for the server side of the app.

I don't know enough about CleverCloud to have a sense of how well their offerings fit your needs, and if you're comfortable with what they provide then by all means continue with them.

But if you're looking for more a service where the provider takes on most of the responsibility for managing the server, I believe you'll find LiveCloud worth considering,.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”