<commit_before>'use strict';

var Table = require(__dirname + '/../../lib/table');
var Harness = require('./support');

var group = Table.define({
  name: 'group',
  columns: [{
    name: 'id',
    dataType: 'varchar(100)'
  }, {
    name: 'user_id',
    dataType: 'varchar(100)'
  }]
});

Harness.test({
  query : group.create(),
  pg    : 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))',
  sqlite: 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))',
  mysql : 'CREATE TABLE `group` (`id` varchar(100), `user_id` varchar(100))',
  params: []
});

Harness.test({
  query : group.create().ifNotExists(),
  pg    : 'CREATE TABLE IF NOT EXISTS "group" ("id" varchar(100), "user_id" varchar(100))',
  sqlite: 'CREATE TABLE IF NOT EXISTS "group" ("id" varchar(100), "user_id" varchar(100))',
  mysql : 'CREATE TABLE IF NOT EXISTS `group` (`id` varchar(100), `user_id` varchar(100))',
  params: []
});

Harness.test({
  query : Table.define({ name: 'user', columns: [{ name: 'id', dataType: 'varchar(100)' }], engine: 'InnoDB' }).create(),
  pg    : 'CREATE TABLE "user" ("id" varchar(100))',
  sqlite: 'CREATE TABLE "user" ("id" varchar(100))',
  mysql : 'CREATE TABLE `user` (`id` varchar(100)) ENGINE=InnoDB'
});

Harness.test({
  query : Table.define({ name: 'user', columns: [{ name: 'id', dataType: 'varchar(100)' }], charset: 'latin1' }).create(),
  pg    : 'CREATE TABLE "user" ("id" varchar(100))',
  sqlite: 'CREATE TABLE "user" ("id" varchar(100))',
  mysql : 'CREATE TABLE `user` (`id` varchar(100)) DEFAULT CHARSET=latin1'
});
<commit_msg>another test for charset and engine<commit_after>'use strict';

var Table = require(__dirname + '/../../lib/table');
var Harness = require('./support');

var group = Table.define({
  name: 'group',
  columns: [{
    name: 'id',
    dataType: 'varchar(100)'
  }, {
    name: 'user_id',
    dataType: 'varchar(100)'
  }]
});

Harness.test({
  query : group.create(),
  pg    : 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))',
  sqlite: 'CREATE TABLE "group" ("id" varchar(100), "user_id" varchar(100))',
  mysql : 'CREATE TABLE `group` (`id` varchar(100), `user_id` varchar(100))',
  params: []
});

Harness.test({
  query : group.create().ifNotExists(),
  pg    : 'CREATE TABLE IF NOT EXISTS "group" ("id" varchar(100), "user_id" varchar(100))',
  sqlite: 'CREATE TABLE IF NOT EXISTS "group" ("id" varchar(100), "user_id" varchar(100))',
  mysql : 'CREATE TABLE IF NOT EXISTS `group` (`id` varchar(100), `user_id` varchar(100))',
  params: []
});

Harness.test({
  query : Table.define({ name: 'user', columns: [{ name: 'id', dataType: 'varchar(100)' }], engine: 'InnoDB' }).create(),
  pg    : 'CREATE TABLE "user" ("id" varchar(100))',
  sqlite: 'CREATE TABLE "user" ("id" varchar(100))',
  mysql : 'CREATE TABLE `user` (`id` varchar(100)) ENGINE=InnoDB'
});

Harness.test({
  query : Table.define({ name: 'user', columns: [{ name: 'id', dataType: 'varchar(100)' }], charset: 'latin1' }).create(),
  pg    : 'CREATE TABLE "user" ("id" varchar(100))',
  sqlite: 'CREATE TABLE "user" ("id" varchar(100))',
  mysql : 'CREATE TABLE `user` (`id` varchar(100)) DEFAULT CHARSET=latin1'
});

Harness.test({
  query : Table.define({ name: 'user', columns: [{ name: 'id', dataType: 'varchar(100)' }], engine: 'MyISAM', charset: 'latin1' }).create(),
  pg    : 'CREATE TABLE "user" ("id" varchar(100))',
  sqlite: 'CREATE TABLE "user" ("id" varchar(100))',
  mysql : 'CREATE TABLE `user` (`id` varchar(100)) ENGINE=MyISAM DEFAULT CHARSET=latin1'
});

{'fraction_non_alphanumeric': 0.21836158192090396, 'fraction_numerical': 0.0423728813559322, 'mean_word_length': 4.6117274167987325, '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': '4608303', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1255, 'n_words': 347}