Skip to content

Instantly share code, notes, and snippets.

-- Configure test database
USE master;
CREATE DATABASE TestDBR;
USE TestDBR;
CREATE TABLE Inventory (id INT, name NVARCHAR(50), quantity INT)
INSERT INTO Inventory VALUES (1, 'banana', 150); INSERT INTO Inventory VALUES (2, 'orange', 154);
-- Grant public master access
USE master;
@mgibson91
mgibson91 / tstest.ts
Created September 21, 2018 10:26
Illustrates how to define a generic object which can contain multiple value types
interface PrimitivesObject {
[key: string]: string | number;
}
function printPrimitives(data: PrimitivesObject) {
Object.entries(data).forEach(entry => console.log(`Key: ${entry[0]}, Value: ${entry[1]}`));
}
printPrimitives({
a: 1,