Databases

postgressql - ⚠️ Restrict PostgreSQL users to only one session each

⚠️ Restrict PostgreSQL users to only one session each

Recently we had a case where we needed to limit the PostgreSQL user activities to only a single connection per user, and in this article I’m going to share the experience with you. The connection limit is applied during the session connection...

47477220 22c20c00 d7f2 11e8 9a7d 551abf2a4bfa - Real-time 👀 viewing using pg_activity and pgAdmin

Real-time 👀 viewing using pg_activity and pgAdmin

pg_activity is a great command-line tool for PostgreSQL server activity monitoring., and we are gonna show you how to install it and use it on a Linux machine. But what happens when someone that doesn’t have access to that Linux machine, wants...

nodejs - node-orm2 — Node.js Object Relational Mapping 🧭

node-orm2 — Node.js Object Relational Mapping 🧭

ORM Package for Node.js. Works with MySQL, PostgreSQL and SQLite. var orm = require('orm'); orm.connect("mysql://username:password@host/database", function (err, db) { if (err) throw err; var Person = db.define('person', { name : String, surname :...

Cover Image by MilesAndryPrower on DeviantArt

MySQL Select Statements

The SELECT statement is used to select or fetch data from a your MySQL Database. It’s the most common type of query issued to a database. There are many ways to query a database, but were going to focus on the SELECT statement...

Cover Image by MilesAndryPrower on DeviantArt

☑ Optimize a MySQL database

If you have deleted a large part of your table or updated many variable length rows, you should consider running the optimize command. If you want to quickly generate the optimize commands for every table in you database, executing the...

mongodb - SQL to Mongo correspondence table

SQL to Mongo correspondence table

This list is the PHP version »SQL to Mongo correspondence table (there is a more general version in the official MongoDB manual). SQL queryMongo query statementCREATE TABLE USERS (a Number, b Number)Implicit creation...

Cover Image by MilesAndryPrower on DeviantArt

SQL Myth: Truncate table can not be rolled back

I heard this one again last week, and I’m not sure why it’s still going around. Microsoft changed the behavior of Truncate Table to be able to be rolled back, but this myth had been taught to DBAs for so many years, that I think some...