<commit_before>'use strict';

var Harness = require('./support');
var post = Harness.definePostTable();
var bar = Harness.definePostTable();

Harness.test({
  query: post.select(post.star()).forUpdate(),
  pg: {
    text  : 'SELECT "post".* FROM "post" FOR UPDATE',
    string: 'SELECT "post".* FROM "post" FOR UPDATE'
  },
  mysql: {
    text  : 'SELECT `post`.* FROM `post` FOR UPDATE',
    string: 'SELECT `post`.* FROM `post` FOR UPDATE'
  },
  params: []
});<commit_msg>[ADD] tests for for share<commit_after>'use strict';

var Harness = require('./support');
var post = Harness.definePostTable();
var user = Harness.defineUserTable();

Harness.test({
  query: post.select(post.star()).forShare(),
  pg: {
    text  : 'SELECT "post".* FROM "post" FOR SHARE',
    string: 'SELECT "post".* FROM "post" FOR SHARE'
  },
  params: []
});

Harness.test({
  query: post.select(post.star()).from(post.join(user).on(user.id.equals(post.userId))).where(post.content.equals('foo')).forShare(),
  pg: {
    text  : 'SELECT "post".* FROM "post" INNER JOIN "user" ON ("user"."id" = "post"."userId") WHERE ("post"."content" = $1) FOR SHARE',
    string: 'SELECT "post".* FROM "post" INNER JOIN "user" ON ("user"."id" = "post"."userId") WHERE ("post"."content" = \'foo\') FOR SHARE'
  },
  params: ["foo"]
});
{'fraction_non_alphanumeric': 0.21417565485362094, 'fraction_numerical': 0.0007704160246533128, 'mean_word_length': 4.054474708171206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2865491', 'n_tokens_mistral': 463, 'n_tokens_neox': 447, 'n_words': 117}