• Complain

Richard Dallaway - Essential Slick 2

Here you can read online Richard Dallaway - Essential Slick 2 full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, publisher: Underscore Consulting LLP, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Richard Dallaway Essential Slick 2

Essential Slick 2: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Essential Slick 2" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Essential Slick is a guide to building a database application using the Slick library. It is aimed at Scala developers who need to become productive with Slick quickly. Weve seen that developers using Slick for the first time often need help getting started with the library. For example, there are unfamiliar concepts to learn and work with, such as database actions. This text gives an understanding of how to work with Slick by walking through the common tasks, explaining the methods and types you see, and providing exercises.

Richard Dallaway: author's other books


Who wrote Essential Slick 2? Find out the surname, the name of the author of the book and a list of all author's works by series.

Essential Slick 2 — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Essential Slick 2" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Essential Slick
Essential Slick Richard Dallaway and Jonathan Ferguson First Edition for Slick - photo 1
Essential Slick
Richard Dallaway and Jonathan Ferguson
First Edition for Slick 2.1, July 2015

Essential Slick

Copyright 2015 Richard Dallaway and Jonathan Ferguson.

Published by Underscore Consulting LLP, Brighton, UK.


Copies of this, and related topics, can be found at .

Our courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Underscore titles, please visit http://underscore.io/training.


Disclaimer: Every precaution was taken in the preparation of this book. However, the author and Underscore Consulting LLP assume no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.

Preface

Essential Slick is aimed at beginner-to-intermediate Scala developers who want to get started using Slick.

Slick is a Scala library for working with databases: querying, inserting data, updating data, and representing a schema. Queries are written in Scala and type checked by the compiler. Slick aims to make working with a database similar to working with regular Scala collections.

This material is aimed at a Scala developer who has:

  • a working knowledge of Scala (we recommend Essential Scala or an equivalent book);
  • experience with relational databases (familiarity with concepts such as rows, columns, joins, indexes, SQL); and
  • an installed JDK 7, along with a programmers text editor or IDE (Scala IDE for Eclipse or IntelliJ are both good choices).

The material presented focuses on Slick version 2.1.0. Examples use H2 as the relational database.

Many thanks to Dave Gurnell, and the team at Underscore for their invaluable contributions and proof reading.

How to Contact Us

You can provide feedback on this text via:

  • our Gitter channel; or
  • email to using the subject line of Essential Slick.

The Underscore Newsletter contains announcements regarding this and other publications from Underscore.

You can follow us on Twitter as @underscoreio.

Conventions Used in This Book

This book contains a lot of technical information and program code. We use the following typographical conventions to reduce ambiguity and highlight important concepts:

Typographical Conventions

New terms and phrases are introduced in italics. After their initial introduction they are written in normal roman font.

Terms from program code, filenames, and file contents, are written in monospace font. Note that we do not distinguish between singular and plural forms. For example, might write String or Strings to refer to the java.util.String class or objects of that type.

References to external resources are written as hyperlinks. References to API documentation are written using a combination of hyperlinks and monospace font, for example: scala.Option.

Source Code

Source code blocks are written as follows. Syntax is highlighted appropriately where applicable:

object MyApp extends App { println ( "Hello world!" ) // Print a fine message to the user! }

Some lines of program code are too wide to fit on the page. In these cases we use a continuation character (curly arrow) to indicate that longer code should all be written on one line. For example, the following code:

println ( "This code should all be written on one line. ")

should actually be written as follows:

println ( "This code should all be written on one line." )
Callout Boxes

We use three types of callout box to highlight particular content:

Tip callouts indicate handy summaries, recipes, or best practices.

Advanced callouts provide additional information on corner cases or underlying mechanisms. Feel free to skip these on your first read-throughcome back to them later for extra information.

Warning callouts indicate common pitfalls and gotchas. Make sure you read these to avoid problems, and come back to them if youre having trouble getting your code to run.

Basics
1.1 Orientation

Slick is a Scala library for accessing relational databases using an interface similar to the Scala collections library. You can treat queries like collections, transforming and combining them with methods like map, flatMap, and filter before sending them to the database to fetch results. This is how well be working with Slick for the majority of this text.

Standard Slick queries are written in plain Scala. These are type safe expressions that benefit from compile time error checking. They also compose, allowing us to build complex queries from simple fragments before running them against the database. If writing queries in Scala isnt your style, youll be pleased to know that Slick also supports plain SQL queries that look more like the prepared statements you may be used to from JDBC.

In addition to querying, Slick helps you with all the usual trappings of relational database, including connecting to a database, creating a schema, setting up transactions, and so on. You can even drop down below Slick to deal with JDBC directly, if thats something youre familiar with and find you need.

This book provides a compact, no-nonsense guide to everything you need to know to use Slick in a commercial setting:

  • Chapter 1 provides an abbreviated overview of the library as a whole, demonstrating the fundamentals of data modelling, connecting to the database, and running queries.
  • Chapter 2 covers basic select queries, introducing Slicks query language and delving into some of the details of type inference and type checking.
  • Chapter 3 covers queries for inserting, updating, and deleting data.
  • Chapter 4 discusses data modelling, including defining custom column and table types.
  • Chapter 5 explores advanced select queries, including joins and aggregates.
  • Chapter 6 provides a brief overview of Plain SQL queriesa useful tool when you need fine control over the SQL sent to your database.

Slick isnt an ORM

If youre familiar with other database libraries such as Hibernate or Active Record, you might expect Slick to be an Object-Relational Mapping (ORM) tool. It is not, and its best not to think of Slick in this way.

ORMs attempt to map object oriented data models onto relational database backends. By contrast, Slick provides a more database-like set of tools such as queries, rows and columns. Were not going to argue the pros and cons of ORMs here, but if this is an area that interests you, take a look at the Coming from ORM to Slick article in the Slick manual.

If you arent familiar with ORMs, congratulations. You already have one less thing to worry about!

1.2 Running the Examples and Exercises

The aim of this first chapter is to provide a high-level overview of the core concepts involved in Slick, and get you up and running with a simple end-to-end example. You can grab this example now by cloning the Git repo of exercises for this book:

bash $ git clone git@github.com:underscoreio/essential-slick-code.git Cloning into 'essential-slick-code' ... bash $ git checkout 2.1 bash $ cd essential-slick-code bash $ ls -1 README.md chapter-01 chapter-02 chapter-03 chapter-04 chapter-05 chapter-06
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Essential Slick 2»

Look at similar books to Essential Slick 2. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Essential Slick 2»

Discussion, reviews of the book Essential Slick 2 and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.