We saw in part 1 how to deploy our starter kit in OCI, and in part 2 how to connect to the compute instance. We will now check which development languages are available on the compute instance acting as the application server. After that, we will see how easy it is to install a new […]
Is SQL, or Structured Query Language, a programming language?
That’s a great question! A question that many answer with
emphasis: “No, SQL is not a programming language!” There
are some who answer yes; and they usually qualify that answer
with something like: “SQL is a programming language designed
to communicate with relational databases.”
It strikes me that those saying “yes” are saying that SQL is only a collection of interface methods to read from and write to a database engine. Those saying SQL is not a programming language often qualify that a programming language must have conditional logic and iterative structures, which don’t exist in SQL.
There’s a third group that are fence sitters. They decline to say whether SQL is a programming language, but they also say individuals who only write SQL aren’t programmers. That’s a bit harsh from my perspective.
Before …
[Read more]While I blogged about how to setup Node.js and MySQL almost two years ago, it was interesting when a student ran into a problem. The student said they’d configured the environment but were unable to use Node.js to access MySQL.
The error is caused by this import statement:
const mysql = require('mysql')
The student got the following error, which simply says that they hadn’t installed the Node.js package for MySQL driver.
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'mysql'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/student/Data/cit325/oracle-s/lib/Oracle12cPLSQLCode/Introduction/query.js:4:15)
at Module._compile …[Read more]
A student question: Does JavaScript make context switching for web-based applications obsolete? Wow! I asked what that meant. He said, it means JavaScript replaces all other server-side programming languages, like PHP, C#, or Python. I asked the student why he believed that. His answer was that’s what two interviewing managers told him.
I thought it would be interesting to put the idea to a test.
Below is a Node.js script that acts as a utility that
queries the MySQL database with substitution variables in query.
It also returns a standard out (stdout) stream of
the MySQL query’s results. It also supports three flag and value
pairs as arguments, and optionally writes the results of the
MySQL query to a log file while still returning result as the
stdout value. All errors are written to the standard
error (stderr) stream.
The Node.js solution is completely portable between Windows …
[Read more]Sometimes, you just half to chuckle. A couple folks felt that I didn’t give enough information in my post showing how to configure a small Node.js application that could access a MySQL database. Specifically, they wanted me to explain the following:
- Configure your Express.js and MySQL development in a single Node.js application.
- How to convert the list of
RowDataPacketobjects as elements of data, which is really just simple JavaScript knowledge. - How to bind variables into the query.
Like the other blog post, this one assumes you’ve performed a global install of Node.js on a Linux server. If you’re unfamiliar with how to perform a global Node.js installation, I cover how to do it in this …
[Read more]These are my notes for creating a small Node.js application that queries a MySQL database. The post will show you how to:
- Configure your Node.js development directory.
- Build a small application to test a MySQL connection.
- Build a small application that connects to the MySQL database and queries data.
This blog post assumes you’ve performed a global install of Node.js on a Linux server. If you’re unfamiliar with how to perform a global Node.js installation, I cover how to do it in this earlier blog post.
Before you write the Node.js applicaiton, you need to setup a
db developer directory. Then, create a
node_modules symbolic link to the
/usr/local/lib/node_modules directory in the
db directory. You can use the following command …
Dear MySQL users,
MySQL Connector/Node.js is a new Node.js driver for use with the
X
DevAPI. This release, v8.0.19, is a maintenance release of
the
MySQL Connector/Node.js 8.0 series.
The X DevAPI enables application developers to write code that
combines
the strengths of the relational and document models using a
modern,
NoSQL-like syntax that does not assume previous experience
writing
traditional SQL.
MySQL Connector/Node.js can be downloaded through npm (see
https://www.npmjs.com/package/@mysql/xdevapi for
details) or from
https://dev.mysql.com/downloads/connector/nodejs/.
To learn more about how to write applications using the X DevAPI,
see
…
Introduction
What is the X-DevApi? From insidemysql.com there is a definition of the X-DevAPI and its features in the following paragraphs:
The X DevAPI is the common client-side API used by all connectors to abstract the details of the X Protocol. It specifies the common set of CRUD-style functions/methods used by all the official connectors to work with both document store collections and relational tables, a common expression language to establish query properties such as criteria, projections, aliases, and a standard set of additional database management features for handling things like transactions, indexes, etc.
The fact that most of these features share the same format and API between connectors, makes the X DevAPI a perfect fit for modern polyglot development environments such as microservices, and the fact that they are based on a …
[Read more]As you may have heard, MySQL 8.0 is now officially GA, and it comes with a bunch of additional goodies. Among those is the brand new Connector/Node.js, which is the official MySQL driver for Node.js and, currently, the only one with support for the latest server versions and features (such as the MySQL document store).
Here’s a rundown of what’s available:
- Out-of-the box support for MySQL 8.0
- Document-store API as a first-class citizen
- TLS/SSL and SHA256 authentication
- Fluent API with support for flexible parameters
- Semantic methods to encode common CRUD operations
- Modern Node.js asynchronous interface based on Promises
- Abstractions for common database development tasks
- Transactions, savepoints and row locking
MySQL 8.0
…
[Read more]
The website or mobile app is the storefront for participating in the modern digital era. It’s your portal for inviting users to come and survey your products and services. Much attention focuses on front-end development; this is where the HMTL5, CSS, and JavaScript are coded to develop the landing page that everyone sees when they visit your site.
But the real magic happens on the backend. This is the ecosystem that really powers your website. One writer has articulated this point very nicely as follows:
The technology and programming that “power” a site—what your end user doesn’t see but what makes the site run—is called the back end. Consisting of the server, the database, and the server-side applications, it’s the behind-the-scenes functionality—the brain of a site. …
[Read more]