Coder Social home page Coder Social logo

go-linq's Introduction

A powerful language integrated query library for Go. Inspired by Microsoft's LINQ.

  • No dependencies: written in vanilla Go!
  • Tested: 100.0% code coverage on all stable releases.
  • Backwards compatibility: Your integration with the library will not be broken except major releases.

Installation

$ go get github.com/ahmetalpbalkan/go-linq

Quick Start

Example query: Find names of students over 18:

import . "github.com/ahmetalpbalkan/go-linq"
	
type Student struct {
    id, age int
    name string
}

over18Names, err := From(students)
	.Where(func (s T) (bool,error){
		return s.(*Student).age >= 18, nil
	})
	.Select(func (s T) (T,error){
		return s.(*Student).name, nil
	}).Results()

Documentation

Here is wiki:

  1. Install & Import
  2. Quickstart (Crash Course)
  3. Parallel LINQ
  4. Table of Query Functions
  5. Remarks & Notes
  6. FAQ

License

This software is distributed under Apache 2.0 License (see LICENSE for more).

Disclaimer

As noted in LICENSE, this library is distributed on an "as is" basis and author's employment association with Microsoft does not imply any sort of warranty or official representation the company. This is purely a personal side project developed on spare times.

Authors

Ahmet Alp Balkan โ€“ @ahmetalpbalkan

Release Notes


v0.9-rc4
* GroupBy()

v0.9-rc3.2
* bugfix: All() iterating over values instead of indices

v0.9-rc3.1
* bugfix: modifying result slice affects subsequent query methods

v0.9-rc3
* removed FirstOrNil, LastOrNil, ElementAtOrNil methods 

v0.9-rc2.5
* slice-accepting methods accept slices of any type with reflections

v0.9-rc2
* parallel linq (plinq) implemented
* Queryable separated into Query & ParallelQuery
* fixed early termination for All

v0.9-rc1
* many linq methods are implemented
* methods have error handling support
* type assertion limitations are unresolved
* travis-ci.org build integrated
* open sourced on github, master & dev branches

go-linq's People

Contributors

ahmetb avatar se77en avatar dericofilho avatar merty avatar elimisteve avatar yoppi avatar

Watchers

James Cloos avatar Keith Ball avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.