<?php
// place PHP code here
?>
| <?php | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |
The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:
from
- Create a desktop shortcut called "Lighthouse WSL Setup" with the following:
powershell.exe iex ((New-Object System.Net.WebClient).DownloadString('https://git.io/JM2dE'))
Windows Defender sometimes mistakenly reports PowerShell shortcuts as a "threat". Its not and you can safely allow this shortcut but if you prefer, you can instead run the following command from within PowerShell (run as Admin the first time)
| [ | |
| { | |
| "body": "Great article!", | |
| "id": 1, | |
| "userId": 1, | |
| "user": { | |
| "name": "Jane", | |
| "id": 1 | |
| } | |
| } |
| const comments = await Comment.findAll( { include: User }); | |
| console.log(JSON.stringify(comments, null, 2)); |
| [ | |
| { | |
| "body": "Great article!", | |
| "id": 1, | |
| "userId": 1, | |
| } | |
| ] |
| // get User data | |
| const user = await User.findByPk(1); | |
| // get Comment data via the 'user' instance | |
| const comments = await user.getComments(); | |
| console.log(JSON.stringify(comments, null, 2)); |
| Movie.belongsToMany(Actor, { through: 'ActorMovies' }); | |
| Actor.belongsToMany(Movie, { through: 'ActorMovies' }); |