What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-01-30 19:46:02
Check if value exisits update or insert sQL
if exists(select 1 from INFORMATION_SCHEMA.TABLES T where T.TABLE_NAME = 'Bookings') begin drop table Bookings end GO create table Bookings( FlightID int identity(1, 1) primary key, TicketsMax int not null, TicketsBooked i... Add solution -
Dart 2022-01-30 13:30:40
dart inline if else
int minVal = (a < b) ? a : b; // if(a < b) {minVal = a;} else {minVal = b;} var x = y ?? z; // assign y to x if y is not null, else z var x ??= y; // assign y to x only if x is null myObject?.myProp // (myObject != null) ? myObject.m... Add solution -
SQL 2022-01-29 10:36:41
mysql Puede ser solamente un campo automatico y este debe ser definido como una clave
-- ---------------------------- -- Table structure for `prefix_admintools_badwords` -- ---------------------------- DROP TABLE IF EXISTS `prefix_admintools_badwords`; CREATE TABLE `prefix_admintools_badwords` ( `id` bigint(20) UNSIGNED NOT NULL AUTO_INC... Add solution -
Other 2022-01-28 22:55:26
gorm boolean struct
type data definition for struct using gorm same with your provider dbms use, example me using postgres type EntityUsers struct { ID uint `gorm:"type:bigserial;primaryKey;autoIncrement"` Fullname string `gorm:"type:varchar(255);... Add solution -
TypeScript 2022-01-28 22:20:27
constraints types
NOT NULL # Ensures a column cannot have a NULL value UNIQUE # Ensures all values in a column are unique PRIMARY KEY # Identifies a record in a table, is NOT NULL & UNIQUE FOREIGN KEY # References a unique record from another table CHECK # Ens... Add solution