Skip to content

Instantly share code, notes, and snippets.

View Mau5Machine's full-sized avatar

Christian Martins Mau5Machine

View GitHub Profile
type User {
id: ID! @id
createdAt: DateTime!
updatedAt: DateTime!
firstName: String!
lastName: String!
email: String! @unique
password: String!
phone: String!
responseRate: Float
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 25, 2024 16:50
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@benbalter
benbalter / wp-db.tutorial.php
Created January 13, 2012 18:41
WordPress DB Tutorial
<?php
//absolute path to wp-load.php, or relative to this script
//e.g., ../wp-core/wp-load.php
include( 'trunk/wp-load.php' );
//grab the WPDB database object, using WP's database
//more info: http://codex.wordpress.org/Class_Reference/wpdb
global $wpdb;