this repo has no description

authored by

Max Bernstein and committed by
GitHub
f7bf4a09 e65d8e7d

+5 -8
+5 -8
db.py
··· 119 119 120 120 def DISTINCT(self, table, columns): 121 121 _distinct = {US.join(str(row[col]) for col in columns): row for row in table.rows} 122 - newRows = [] 123 - for key in _distinct: 124 - newRow = {} 125 - for col in columns: 126 - newRow[col] = _distinct[key][col] 127 - newRows.append(newRow) 128 - return Table(table.name, newRows) 122 + return Table(table.name, [ 123 + {col: _distinct[key][col] for col in columns} 124 + for key in _distinct 125 + ]) 129 126 130 127 131 128 def __repr__(self): ··· 157 154 158 155 159 156 result = User 160 - result = db.UPDATE(User, {"name": "CHUCK"}, lambda row: row["id"] == 2) 157 + # result = db.UPDATE(User, {"name": "CHUCK"}, lambda row: row["id"] == 2) 161 158 result = db.DISTINCT(result, ["name"]) 162 159 print(result)