6 kyu
I Liked the SQL Better...
1,046 of 1,123xcthulhu
Loading description...
SQL
Databases
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
C translation
(author is gone)
First kata to
#include <sqlite3.h>
:pThis comment has been hidden.
holy fuck... x/
Finally found what I forgot to do... But the description still needs to be improved, in addition to the tests (see issue below)
Hi @Blind4Basics, could you explain what should equal set() means? I don't really get it. By data, i just mean the data from the table. Basically the same question as yours.
Thanks!
2 year, ago => I don't remember... I'd bet on "don't mutate the input"?
note, I just saw that actual and expected are swapped in the test, so the empty set is your output
hmm, okay i'll check that. I'll let you know if I have any more questions. Thanks!
Alright, I figured it out. Thanks @Blind4Basics
Just dont forget to commit
The user can insert the same rows multiple times and still pass the tests in Python (at least).
This comment has been hidden.
More description, please... 2 sentences about sqlite3, at least a link about the reference of the python api.
Figuring out how a built-in library works is a part of the task.
I'm receiving this message. Is it saying there is no movies table in the database?
Fetching movies from /tmp/movies.db There's just one table, called 'MOVIES' [] should equal [(u'MOVIES',)]
The code I've submitted works locally. I've verified that the table is created and has the data.
Did you ever resolve this?
I don't quite understand what does this line from the question means "You will be expected to create a monadic action mkMoviesDB :: IO ()"
can someone plz explain?
thanks
This line probably applies to Haskell only.
I am having a similiar issue in Python. The returned row order does not match the order the test case expects. There is no way to order the rows without including a select using hte orderby clause. The kata only deals with creating a database and populating it. Help.
I really wish the instructions were more specific on what the expected output should be. I've created a table named movies with columns for Name, Year, and Rating. The instructions do not state if they expect seperate columns for these values or what data types they expect for the entries. Pretty frustrating when I know the answer is right but I can't get the system to accept it because I don't know what my submission is being tested for...
Are others getting this error with the submission test?
/tmp/movies.db contains the movies we expect PatternMatchFail (/tmp/haskell11494-7-17i2xvv/Main.hs:(25,5)-(26,62): Non-exhaustive patterns in function toMovie )
0 Passed 0 Failed 1 Errors
Process took 2667ms to complete
Also, I think some test cases in the kata would help make it easier to understand the spec. "Implement a sqlite database with this in it" without test cases I think confuses some. :)
What I wrote works locally, but errors on CW. Can someone give me a hint?
/tmp/haskell114830-10-1iku8z7/Main.hs:21:18: Ambiguous occurrence
Movie' It could refer to either
Main.Movie', defined at /tmp/haskell114830-10-1iku8z7/Main.hs:19:6 orMovies.Movie', imported from
Movies' at /tmp/haskell114830-10-1iku8z7/Main.hs:17:1-13 (and originally defined at /tmp/haskell114830-10-1iku8z7/Movies.hs:(18,1)-(24,2))This comment has been hidden.
Haskell test expects 'Title' column for titles, but the table in the description has 'Name' column.
Fixed.
.
For some reason, I keep getting "Submission timed out" in the Haskell version of the kata. I thought it was fairly straightforward and it should not take that long to connect to a Sqlite3 database. So that's a puzzler.
Can you throw your solution in a kumite?
I finally got it. The timeout was a result of accidentally omitting the module line from the solution and I realized that while doing another Haskell kata. Weird.
This comment has been hidden.
Maybe you are forgetting to commit the changes?
I just met the same problem....
How am I supossed to pass this kata? Should I write my own test cases to pass it?
Well, the instructions were pretty straight forward. If you want to write your own tests as you work on it, you can share them as a kumite and I can put them in...
This comment has been hidden.
I wrote some hints for you... please send me a message if you have any more questions. http://www.codewars.com/kumite/53f0187ab9cb37ba2300030d?sel=53f0187ab9cb37ba2300030d
This comment has been hidden.
According to the submission checks, I am saving the right items but they are coming back in the wrong order. I save them to the db in the same order as they are presented in the instructions. Any ideas? Perhaps the submission check should sort the items pulled from the db?
I can't see your code so I can't help you debug this. Maybe you could post it in a kumite and I could look at it for you?
BAM! http://www.codewars.com/kumite/53e96affe95f1a9a75000122/edit Thanks for your assistance!
Thanks a lot farlee! I left a comment on your kumite...
Thanks for your help! I feel a bit silly now that i see the error...
How was this a silly error? Why is this type of insertion required to beat this kata?
An example test case would be nice.
What should I be testing exactly? That you made the sqlite database file?
Yes, actually. I think that'd be great. You can check for exists as a start. :)
I'm getting the following error:
File "", line 17 import sqlite3 ^ SyntaxError: invalid syntax
the error is coming from code I didn't write (I only have 14 lines)
I originally tried to import sqlite3 myself and then removed it when I saw this error. The error still happens without my import though.
The error is coming from the test suite. Not sure why this is happening...
Moreover, codewars adds some code before the text fixture; this is probably why its saying line 17. Still, I can't reproduce this error...