Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Coffeescript Application Development Cookbook
  • Table Of Contents Toc
Coffeescript Application Development Cookbook

Coffeescript Application Development Cookbook

By : Hatfield
4.6 (5)
close
close
Coffeescript Application Development Cookbook

Coffeescript Application Development Cookbook

4.6 (5)
By: Hatfield

Overview of this book

If you are interested in developing modern applications, this book will help you leverage the vast JavaScript ecosystem while using an elegant language, helping you avoid the shortcomings of JavaScript.
Table of Contents (13 chapters)
close
close
12
Index

Working with SQLite


SQLite is a lightweight, schema-based relational database engine that executes within the memory context of our application. This proves to be very convenient when developing your application, as SQLite does not require a database server.

Getting started

We will be using the sqlite3 Node module. You can install this module using NPM as follows:

$ npm install sqlite3

Once installed, you can require it in your application using the following:

sqlite = require 'sqlite3'

Once required, you can create a connection to an existing database by filename:

db = new sqlite3.Database('sample.db')

If the database does not exist, an empty database will be created for you.

We will be using a sample database for our examples, which contains a simple Employees and Departments table. We can see these tables in the following diagram:

Inserting and updating records, and executing commands

Now that we have an empty database, we will create our tables and insert some records.

We will use the Node sqlite3...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Coffeescript Application Development Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon