How to use the Raw function from typeorm

Find comprehensive JavaScript typeorm.Raw code examples handpicked from public code repositorys.

19
20
21
22
23
24
25
26
27
28
},
email: async email => {
  if (/.+\@.+\..+/.test(email)) {
    const { User } = require('@things-factory/auth-base')
    const user = await getRepository(User).findOne({
      where: { email: Raw(alias => `LOWER(${alias}) LIKE '${email.toLowerCase()}'`) }
    })
    return user ? true : chalk.redBright(`There's no user has ${chalk.cyan(email)} as email.`)
  } else {
    return chalk.redBright('Please type right format of email')
fork icon0
star icon0
watch icon8

+ 31 other calls in file

52
53
54
55
56
57
58
59
60
61
subdomain: async subdomain => {
  if (/^[a-z0-9]+$/.test(subdomain)) {
    const { Domain } = require('@things-factory/shell')
    const domain = await getRepository(Domain).findOne({
      where: {
        name: Raw(alias => `LOWER(${alias}) LIKE '${subdomain.toLowerCase()}'`)
      }
    })
    return domain ? chalk.redBright(`There's a domain has ${chalk.cyan(name)} as subdomain already.`) : true
  } else {
fork icon0
star icon0
watch icon8

+ 47 other calls in file