{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simple Example\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Books_be.mdb Books.mdb BooksReadme.txt\n" ] } ], "source": [ "ls examples/ral-books" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Authors\n", "Books\n" ] } ], "source": [ "mdb-tables -1 examples/ral-books/Books_be.mdb" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "AuID,Author,Sequence,Current\n", "1,\"Carlson, Roger\",,1\n", "2,\"Clancy, Tom\",,1\n", "3,\"Shakespeare, William\",,1\n" ] } ], "source": [ "mdb-export examples/ral-books/Books_be.mdb Authors" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "BookID,Author,Title,DatePublished,Comments,LastRead\n", "12,1,\"Tony DeSoto and the Crystal Egg\",\"07/01/01 00:00:00\",\"Very good\",\"06/22/01 00:00:00\"\n", "13,2,\"Hunt for Red October\",\"01/01/95 00:00:00\",\"fair\",\"06/22/01 00:00:00\"\n", "14,3,\"A Mid-Summer Nights Dream\",\"06/06/95 00:00:00\",\"a little dated\",\"06/22/01 00:00:00\"\n", "15,1,\"The Girl Who Would Be Wizard\",\"09/01/01 00:00:00\",\"unknown\",\"06/25/01 00:00:00\"\n", "16,2,\"Patriot Games\",\"01/01/97 00:00:00\",\"Not as good as Red October, but readable\",\"06/25/01 00:00:00\"\n" ] } ], "source": [ "mdb-export examples/ral-books/Books_be.mdb Books" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "name: (none)\n", "\tOrderByOn: no\n", "\n", "name: Title\n", "\tColumnWidth: -1\n", "\tColumnOrder: 0\n", "\tRequired: no\n", "\tColumnHidden: no\n", "\tAllowZeroLength: no\n", "\tDisplayControl: 109\n", "\n", "name: DatePublished\n", "\tColumnWidth: 1530\n", "\tColumnOrder: 0\n", "\tRequired: no\n", "\tColumnHidden: no\n", "\n", "name: Author\n", "\tDecimalPlaces: 255\n", "\tColumnWidth: -1\n", "\tColumnOrder: 0\n", "\tRequired: no\n", "\tColumnHidden: no\n", "\tDescription: foreign key\n", "\tDisplayControl: 109\n", "\n", "name: Comments\n", "\tColumnWidth: -1\n", "\tColumnOrder: 0\n", "\tRequired: no\n", "\tColumnHidden: no\n", "\tAllowZeroLength: no\n", "\tDisplayControl: 109\n", "\n", "name: BookID\n", "\tColumnWidth: -1\n", "\tColumnOrder: 0\n", "\tColumnHidden: no\n", "\n", "name: LastRead\n", "\tColumnWidth: -1\n", "\tColumnOrder: 0\n", "\tDefaultValue: Date()\n", "\tColumnHidden: no\n", "\tRequired: no\n", "\n" ] } ], "source": [ "mdb-prop examples/ral-books/Books_be.mdb Books" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-- ----------------------------------------------------------\n", "-- MDB Tools - A library for reading MS Access database files\n", "-- Copyright (C) 2000-2011 Brian Bruns and others.\n", "-- Files in libmdb are licensed under LGPL and the utilities under\n", "-- the GPL, see COPYING.LIB and COPYING files respectively.\n", "-- Check out http://mdbtools.sourceforge.net\n", "-- ----------------------------------------------------------\n", "\n", "-- That file uses encoding UTF-8\n", "\n", "CREATE TABLE `Authors`\n", " (\n", "\t`AuID`\t\t\tINTEGER, \n", "\t`Author`\t\t\tvarchar, \n", "\t`Sequence`\t\t\tINTEGER, \n", "\t`Current`\t\t\tINTEGER\n", ");\n", "\n", "CREATE TABLE `Books`\n", " (\n", "\t`BookID`\t\t\tINTEGER, \n", "\t`Author`\t\t\tINTEGER, \n", "\t`Title`\t\t\tvarchar, \n", "\t`DatePublished`\t\t\tDateTime, \n", "\t`Comments`\t\t\tvarchar, \n", "\t`LastRead`\t\t\tDateTime\n", ");\n", "\n", "\n", "-- CREATE Relationships ...\n", "ALTER TABLE `Books` ADD CONSTRAINT `Books_Author_fk` FOREIGN KEY (`Author`) REFERENCES `Authors`(`AuID`) ON UPDATE CASCADE;\n" ] } ], "source": [ "mdb-schema examples/ral-books/Books_be.mdb sqlite" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" } }, "nbformat": 4, "nbformat_minor": 2 }