How to use the Bit function from mssql

Find comprehensive JavaScript mssql.Bit code examples handpicked from public code repositorys.

185
186
187
188
189
190
191
192
193
    case 'blob':
        type = mssql.NVarChar;
    
        break;
    case 'bit':
        type = mssql.Bit;

        break;
}
fork icon6
star icon6
watch icon1

25
26
27
28
29
30
31
32
33
34
      }
    }
  }
};

const Bit = sql.Bit;
const TinyInt = sql.TinyInt;
const SmallInt = sql.SmallInt;
const Int = sql.Int;
const BigInt = sql.BigInt;
fork icon0
star icon4
watch icon2

+ 3 other calls in file

81
82
83
84
85
86
87
88
89
        else if (typeName == 'integer') return mssql.Int;
        else if (typeName == 'decimal') return mssql.Float; //TODO - use decimal?
        else if (typeName == 'timestamp') return mssql.VarChar(256); //TODO - use real js dates?
        else if (typeName == 'date') return mssql.VarChar(256); //TODO - use real js dates?
        else if (typeName == 'float') return mssql.Float;
        else if (typeName == 'boolean') return mssql.Bit;

        else throw new Error("unknown type '" + fieldType + "'");
}
fork icon0
star icon2
watch icon3

+ 21 other calls in file

335
336
337
338
339
340
341
342
343
344
    if (value instanceof Date) {
      type = mssql.DateTime2
    } else if (typeof value === 'number') {
      type = mssql.Decimal(('' + value).length, decimalPlaces(value))
    } else if (typeof value === 'boolean') {
      type = mssql.Bit
    }
  }
  return type
}
fork icon1
star icon0
watch icon2

68
69
70
71
72
73
74
75
76
77
78
};


function getSqlType(typeName)
{
    switch(typeName) {
        case 'sql.Bit':              return sql.Bit;
        case 'sql.BigInt':           return sql.BigInt;
        case 'sql.Decimal':          return sql.Decimal;
        case 'sql.Float':            return sql.Float;
        case 'sql.Int':              return sql.Int;
fork icon0
star icon0
watch icon0

+ 5 other calls in file

94
95
96
97
98
99
100
101
102
103
  break;
case 'binary':
  type = mssql.Binary(columnProperty.CHARACTER_MAXIMUM_LENGTH);
  break;
case 'bit':
  type = mssql.Bit();
  break;
case 'char':
  type = mssql.Char(columnProperty.CHARACTER_MAXIMUM_LENGTH);
  break;
fork icon0
star icon0
watch icon1

+ 3 other calls in file