Commit 3eacf7f
committed
Ensure MySQL schema inference loads tables when no schema given
Reminder: MySQL has no concept of schemas, and calls databases schemas
instead. All connections have access to all databases on that server
that the user has permission to access.
On PG, the default schema is always simply called `public`. For MySQL,
it'll be based on the connection URL. In theory we could actually get
this information without executing a query, but that would require
adding a method to `Connection` explicitly for this which I don't want
to do. I'm fine with just executing a query.
As an aside, I really want to find a way to require `String:
FromSql<types::Text, Self>` as a constraint of `Backend` without forcing
that to be specified *every* time I do `DB: Backend`.
I haven't written a test case for this, since I still need to figure out
what we're going to do about tests which need to mutate schema without
fucking with each other.1 parent e5fb60b commit 3eacf7f
1 file changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
| |||
114 | 129 | | |
115 | 130 | | |
116 | 131 | | |
117 | | - | |
| 132 | + | |
118 | 133 | | |
119 | 134 | | |
120 | 135 | | |
| |||
150 | 165 | | |
151 | 166 | | |
152 | 167 | | |
153 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
154 | 172 | | |
155 | 173 | | |
156 | 174 | | |
| |||
0 commit comments