Skip to content

Commit f055866

Browse files
include the discussion of metadata labeling
1 parent ad47e23 commit f055866

File tree

3 files changed

+419
-189
lines changed

3 files changed

+419
-189
lines changed

book/00-introduction/49-connect.ipynb

Lines changed: 42 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
"The following cell sets up the connection to the database for the Jupyter SQL Magic."
4141
]
4242
},
43-
{
44-
"cell_type": "markdown",
45-
"metadata": {},
46-
"source": []
47-
},
4843
{
4944
"cell_type": "code",
5045
"execution_count": null,
@@ -76,64 +71,6 @@
7671
"%sql mysql+pymysql://dev:devpass@db"
7772
]
7873
},
79-
{
80-
"cell_type": "markdown",
81-
"metadata": {},
82-
"source": [
83-
"# Connect with DataJoint \n",
84-
"\n",
85-
"\n",
86-
"\n",
87-
"The DataJoint client library uses these environment variables to connect to the database.\n",
88-
"It sufficient to simply import the datajoint client library.\n",
89-
"It will connect to the database automatically as soon as necessary.\n",
90-
"However, you can explicity verify the connection by calling `dj.conn()`:"
91-
]
92-
},
93-
{
94-
"cell_type": "code",
95-
"execution_count": 1,
96-
"metadata": {},
97-
"outputs": [
98-
{
99-
"name": "stderr",
100-
"output_type": "stream",
101-
"text": [
102-
"[2025-09-16 01:37:46,977][INFO]: DataJoint 0.14.6 connected to dev@db:3306\n"
103-
]
104-
},
105-
{
106-
"data": {
107-
"text/plain": [
108-
"DataJoint connection (connected) dev@db:3306"
109-
]
110-
},
111-
"execution_count": 1,
112-
"metadata": {},
113-
"output_type": "execute_result"
114-
}
115-
],
116-
"source": [
117-
"import datajoint as dj\n",
118-
"dj.conn() # test the connection (optionally)"
119-
]
120-
},
121-
{
122-
"cell_type": "markdown",
123-
"metadata": {},
124-
"source": [
125-
"If you are only learning DataJoint, you are done.\n",
126-
"If you are reading this text to also learn SQL, you can use two ways to issue queries: with IPython magic commands or a client library."
127-
]
128-
},
129-
{
130-
"cell_type": "markdown",
131-
"metadata": {},
132-
"source": [
133-
"If you are only learning DataJoint, you are done.\n",
134-
"If you are reading this text to also learn SQL, you can use two ways to issue queries: with IPython magic commands or a client library."
135-
]
136-
},
13774
{
13875
"cell_type": "markdown",
13976
"metadata": {},
@@ -230,6 +167,48 @@
230167
"SELECT User FROM mysql.user"
231168
]
232169
},
170+
{
171+
"cell_type": "markdown",
172+
"metadata": {},
173+
"source": [
174+
"# Connect with DataJoint \n",
175+
"\n",
176+
"\n",
177+
"\n",
178+
"The DataJoint client library uses these environment variables to connect to the database.\n",
179+
"It sufficient to simply import the datajoint client library.\n",
180+
"It will connect to the database automatically as soon as necessary.\n",
181+
"However, you can explicity verify the connection by calling `dj.conn()`:"
182+
]
183+
},
184+
{
185+
"cell_type": "code",
186+
"execution_count": 1,
187+
"metadata": {},
188+
"outputs": [
189+
{
190+
"name": "stderr",
191+
"output_type": "stream",
192+
"text": [
193+
"[2025-09-16 01:37:46,977][INFO]: DataJoint 0.14.6 connected to dev@db:3306\n"
194+
]
195+
},
196+
{
197+
"data": {
198+
"text/plain": [
199+
"DataJoint connection (connected) dev@db:3306"
200+
]
201+
},
202+
"execution_count": 1,
203+
"metadata": {},
204+
"output_type": "execute_result"
205+
}
206+
],
207+
"source": [
208+
"import datajoint as dj\n",
209+
"dj.conn() # test the connection (optionally)"
210+
]
211+
},
233212
{
234213
"cell_type": "markdown",
235214
"metadata": {},

0 commit comments

Comments
 (0)