Skip to content

Commit 06a9aac

Browse files
committed
hash
1 parent 31bdfbc commit 06a9aac

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

json_sql/tables.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class Column(BaseModel):
1616
is_primary_key: bool = False
1717
foreign_key: Optional[ForeignKey] = None
1818

19+
def __hash__(self):
20+
return hash((self.name, self.type, self.is_primary_key, self.foreign_key))
21+
1922

2023
class Table(BaseModel):
2124
name: str

users.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"name": "John Doe",
4+
"age": 30,
5+
"email": "john.doe@email.com"
6+
},
7+
{
8+
"name": "Jane Smith",
9+
"age": 25,
10+
"email": "jane.smith@email.com"
11+
}
12+
]

0 commit comments

Comments
 (0)